Udostępnij za pośrednictwem


BlockCollection Class

Definition

Represents a collection of Block elements.

public ref class BlockCollection sealed : IIterable<Block ^>, IVector<Block ^>
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class BlockCollection final : IIterable<Block>, IVector<Block>
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class BlockCollection : IEnumerable<Block>, IList<Block>
Public NotInheritable Class BlockCollection
Implements IEnumerable(Of Block), IList(Of Block)
Inheritance
Object Platform::Object IInspectable BlockCollection
Attributes
Implements

Remarks

Enumerating the collection in C# or Microsoft Visual Basic

You can iterate through a BlockCollection object in C# or Microsoft Visual Basic. In many cases, such as using foreach syntax, the compiler does this casting for you and you won't need to cast to IEnumerable<Block> explicitly. If you do need to cast explicitly, for example if you want to call GetEnumerator, cast the collection object to IEnumerable with a Block constraint.

Properties

Size

Gets the size (count) of the collection.

Methods

Append(Block)

Adds a new item to the collection.

Clear()

Removes all items from the collection.

First()

Returns the iterator for iteration over the items in the collection.

GetAt(UInt32)

Returns the item located at the specified index.

GetMany(UInt32, Block[])

Retrieves multiple elements in a single pass through the iterator.

GetView()

Gets an immutable view into the collection.

IndexOf(Block, UInt32)

Retrieves the index of the specified item.

InsertAt(UInt32, Block)

Inserts the specified item at the specified index.

RemoveAt(UInt32)

Removes the item at the specified index.

RemoveAtEnd()

Removes the last item in the collection.

ReplaceAll(Block[])

Initially clears the collection, then inserts the provided array as new items.

SetAt(UInt32, Block)

Sets the value at the specified index to the Block value specified.

Applies to

See also