GeometryCollection 类

定义

表示 Geometry 对象的集合。

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

注解

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

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

构造函数

GeometryCollection()

初始化 GeometryCollection 类的新实例。

属性

Size

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

方法

Append(Geometry)

将新项添加到集合。

Clear()

从集合中移除所有项。

First()

返回集合中项的迭代器。

GetAt(UInt32)

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

GetMany(UInt32, Geometry[])

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

GetView()

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

IndexOf(Geometry, UInt32)

检索指定项的索引。

InsertAt(UInt32, Geometry)

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

RemoveAt(UInt32)

删除指定索引处的项。

RemoveAtEnd()

删除集合中的最后一项。

ReplaceAll(Geometry[])

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

SetAt(UInt32, Geometry)

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

适用于

另请参阅