Share via


PointCollection.GetMany(UInt32, Point[]) 方法

定義

擷取單一傳遞反覆運算器中的多個元素。

public:
 virtual unsigned int GetMany(unsigned int startIndex, Platform::Array <Point> ^ items) = IVector<Point>::GetMany;
uint32_t GetMany(uint32_t const& startIndex, winrt::array_view <Point> & items);
public uint GetMany(uint startIndex, Point[] items);
function getMany(startIndex, items)
Public Function GetMany (startIndex As UInteger, items As Point()) As UInteger

參數

startIndex
UInt32

unsigned int

uint32_t

要從中開始擷取的索引。

items
Point[]

提供結果的目的地。 將初始陣列大小調整為「容量」,以指定應該擷取多少結果。

傳回

UInt32

unsigned int

uint32_t

擷取的項目數目。

實作

M:Windows.Foundation.Collections.IVector1.GetMany(System.UInt32,0[]) M:Windows.Foundation.Collections.IVector1.GetMany(unsigned int,0[]) M:Windows.Foundation.Collections.IVector1.GetMany(uint32_t,0[])

備註

GetMany 方法的運作方式與呼叫 提供的陣列中的每個元素相同。 這表示 GetMany 方法傳回的第一個專案與在呼叫 GetMany 之前擷取 屬性所傳回的專案相同。 GetMany 呼叫傳回之後,屬性會擷取 GetMany 呼叫所傳回最後一個專案後面的元素,如果序列中沒有任何專案存在,則會產生錯誤。

GetMany 方法會傳回實際傳回的專案數目。 它必須是) 集合中剩餘的元素數目下限,或 b) 要求的元素數目,也就是「容量」。 因此,每當 GetMany 傳回小於所要求的元素數目時,即已達到序列的結尾。 它會傳回「實際」輸出參數中擷取的專案數目。

當呼叫端指定容量為 0 時,反覆運算器的位置不會變更。 在傳回的值之後,陣列中的元素不會變更。

適用於