ReadOnlyDictionary<TKey,TValue>.KeyCollection.CopyTo(TKey[], Int32) ReadOnlyDictionary<TKey,TValue>.KeyCollection.CopyTo(TKey[], Int32) ReadOnlyDictionary<TKey,TValue>.KeyCollection.CopyTo(TKey[], Int32) ReadOnlyDictionary<TKey,TValue>.KeyCollection.CopyTo(TKey[], Int32) Method

定义

从特定的数组索引开始,将集合的元素复制到一个数组中。Copies the elements of the collection to an array, starting at a specific array index.

public:
 virtual void CopyTo(cli::array <TKey> ^ array, int arrayIndex);
public void CopyTo (TKey[] array, int arrayIndex);
abstract member CopyTo : 'Key[] * int -> unit
override this.CopyTo : 'Key[] * int -> unit
Public Sub CopyTo (array As TKey(), arrayIndex As Integer)

参数

array
TKey[]

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

arrayIndex
Int32 Int32 Int32 Int32

array 中从零开始的索引,从此处开始复制。The zero-based index in array at which copying begins.

异常

array 是多维的。array is multidimensional.

-or- 源集合中的元素数大于从 arrayIndex 到目标 array 的末尾的可用空间。The number of elements in the source collection is greater than the available space from arrayIndex to the end of the destination array.

-or- 无法自动将类型 T 转换为目标 array 的类型。Type T cannot be cast automatically to the type of the destination array.

适用于