PointCollection 类

定义

表示可通过索引单独访问的 Point 值的集合。

public ref class PointCollection sealed : IIterable<Point>, IVector<Point>
/// [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 PointCollection final : IIterable<Point>, IVector<Point>
/// [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)]
/// [Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
class PointCollection final : IIterable<Point>, IVector<Point>
[Windows.Foundation.Metadata.Activatable(65536, typeof(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 PointCollection : IEnumerable<Point>, IList<Point>
[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)]
[Windows.Foundation.Metadata.Activatable(65536, "Windows.Foundation.UniversalApiContract")]
public sealed class PointCollection : IEnumerable<Point>, IList<Point>
Public NotInheritable Class PointCollection
Implements IEnumerable(Of Point), IList(Of Point)
<object property="oneOrMorePoints"/>
继承
Object Platform::Object IInspectable PointCollection
属性
实现

Windows 要求

设备系列
Windows 10 (在 10.0.10240.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v1.0 中引入)

注解

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

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

构造函数

PointCollection()

初始化 PointCollection 类的新实例。

属性

Size

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

方法

Append(Point)

将新项添加到集合。

Clear()

从集合中移除所有项。

First()

返回集合中项的迭代器。

GetAt(UInt32)

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

GetMany(UInt32, Point[])

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

GetView()

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

IndexOf(Point, UInt32)

检索指定项的索引。

InsertAt(UInt32, Point)

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

RemoveAt(UInt32)

删除指定索引处的项。

RemoveAtEnd()

删除集合中的最后一项。

ReplaceAll(Point[])

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

SetAt(UInt32, Point)

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

适用于

另请参阅