Share via


BrushCollection.GetMany(UInt32, Brush[]) 方法

定义

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

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

参数

startIndex
UInt32

unsigned int

uint32_t

要从中开始检索的索引。

items
Brush[]

提供结果的目标。 将初始数组大小调整为“容量”,以指定应检索的结果数。

返回

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 返回的元素数少于请求的元素数时,就已到达序列的末尾。 它返回在“实际”输出参数中检索到的元素数。

当调用方将容量指定为零时,迭代器的位置保持不变。 数组中返回的值后面的元素保持不变。

适用于