語言

PointCollection 類別

定義

代表一組可依索引逐一存取 的點數 值集合。

public ref class PointCollection sealed : IIterable<Point>, IVector<Point>
/// [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 PointCollection final : IIterable<Point>, IVector<Point>
[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 PointCollection : IEnumerable<Point>, IList<Point>
Public NotInheritable Class PointCollection
Implements IEnumerable(Of Point), IList(Of Point)
<object property="oneOrMorePoints"/>
繼承
Object Platform::Object IInspectable PointCollection
屬性
實作

備註

以 C 語言列舉集合#

PointCollection 是可枚舉的,因此你可以使用語言特定的語法,例如 C# 中的 foreach 來枚舉集合中的項目。 編譯器會幫你做型別,你不需要明確地做 cast IEnumerable<Point> 。 如果你確實需要明確地投射,例如你想呼叫 GetEnumerator,就用 Point 約束投射到 IEnumerable<T>。

建構函式

名稱 Description
PointCollection()

初始化 PointCollection 類別的新實例。

屬性

名稱 Description
Size

取得集合的大小(數量)。

方法

名稱 Description
Append(Point)

將新專案加入至集合。

Clear()

從集合中移除所有專案。

First()

回傳集合中項目的迭代器。

GetAt(UInt32)

回傳位於指定索引的項目。

GetMany(UInt32, Point[])

一次通過迭代器取得多個元素。

GetView()

能獲得一個不可變的收藏畫面。

IndexOf(Point, UInt32)

取得指定項目的索引。

InsertAt(UInt32, Point)

將指定項目插入指定的索引。

RemoveAt(UInt32)

拿掉位於指定索引處的專案。

RemoveAtEnd()

移除收藏中最後一項物品。

ReplaceAll(Point[])

最初清除集合,然後將所提供的陣列插入為新項目。

SetAt(UInt32, Point)

將指定索引的值設為指定的 點 值。

適用於

另請參閱