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

定义

从目标数组的指定索引处开始,将集合复制到兼容的一维 ArrayCopies the collection to a compatible one-dimensional Array, starting at the specified index of the target array.

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

参数

array
Array

一维 Array,用作从集合复制的元素的目标数组。The one-dimensional Array that is the destination of the elements copied from the collection. 该数组的索引必须从零开始。The array must have zero-based indexing.

index
Int32

数组中开始复制的位置的索引(从零开始)。The zero-based index in the array at which copying begins.

实现

例外

array 为 null。array is null.

index 小于零。index is less than zero.

array 是多维的。array is multidimensional.

- 或 --or- GridTableStylesCollection 中的元素数大于从索引到目标数组末尾处的可用空间。The number of elements in the GridTableStylesCollection is greater than the available space from index to the end of the destination array.

集合中的类型无法自动强制转换为目标数组的类型。The type in the collection cannot be cast automatically to the type of the destination array.

适用于