GroupCollection.ICollection.CopyTo(Array, Int32) 方法

定义

将集合的所有元素复制到指定的数组中(从指定索引处开始)。Copies all the elements of the collection to the specified array beginning at the specified index.

 virtual void System.Collections.ICollection.CopyTo(Array ^ array, int arrayIndex) = System::Collections::ICollection::CopyTo;
void ICollection.CopyTo (Array array, int arrayIndex);
abstract member System.Collections.ICollection.CopyTo : Array * int -> unit
override this.System.Collections.ICollection.CopyTo : Array * int -> unit
Sub CopyTo (array As Array, arrayIndex As Integer) Implements ICollection.CopyTo

参数

array
Array

集合要被复制到的一维数组。The one-dimensional array the collection is to be copied into.

arrayIndex
Int32

目标数组中将开始复制的位置的从零开始的索引。The zero-based index in the destination array where copying is to begin.

实现

例外

array 为 null。array is null.

arrayIndexarray 的边界外。- 或 - arrayIndexCountarray 的边界外。arrayIndex is outside the bounds of array.-or-arrayIndex plus Count is outside the bounds of array.

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation. 它只能在 GroupCollection 实例被强制转换为 ICollection 接口时使用。It can be used only when the GroupCollection instance is cast to an ICollection interface.

适用于