BrushCollection 类

定义

表示 Brush 值的有序集合。

public ref class BrushCollection sealed : IIterable<Brush ^>, IVector<Brush ^>
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class BrushCollection final : IIterable<Brush>, IVector<Brush>
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class BrushCollection : IEnumerable<Brush>, IList<Brush>
Public NotInheritable Class BrushCollection
Implements IEnumerable(Of Brush), IList(Of Brush)
继承
Object Platform::Object IInspectable BrushCollection
属性
实现

Windows 要求

设备系列
Windows 10 Anniversary Edition (在 10.0.14393.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v3.0 中引入)

注解

枚举 C# 或 Microsoft Visual Basic 中的集合

BrushCollection 是可枚举的,因此可以使用特定于语言的语法(如 C# 中的 foreach )枚举集合中的项。 编译器为你执行类型强制转换,你无需显式转换为 IEnumerable<Brush> 。 如果需要显式强制转换(例如,如果要调用 GetEnumerator),请使用 Brush 约束强制转换为 IEnumerable<T>

构造函数

BrushCollection()

初始化 BrushCollection 类的新实例。

属性

Size

获取集合的大小 (计数) 。

方法

Append(Brush)

将新项添加到集合。

Clear()

从集合中移除所有项。

First()

返回集合中项的迭代器。

GetAt(UInt32)

返回位于指定索引处的项。

GetMany(UInt32, Brush[])

通过迭代器在一次传递中检索多个元素。

GetView()

获取集合中的不可变视图。

IndexOf(Brush, UInt32)

检索指定项的索引。

InsertAt(UInt32, Brush)

在指定的索引处插入指定的项。

RemoveAt(UInt32)

删除指定索引处的项。

RemoveAtEnd()

删除集合中的最后一项。

ReplaceAll(Brush[])

首先清除集合,然后将提供的数组作为新项插入。

SetAt(UInt32, Brush)

将指定索引处的值设置为指定的 Brush 值。

适用于

另请参阅