ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection.CopyTo(Array, Int32) ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection.CopyTo(Array, Int32) Method

定义

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

 virtual void System.Collections.ICollection.CopyTo(Array ^ array, int index) = System::Collections::ICollection::CopyTo;
void ICollection.CopyTo (Array array, int index);

参数

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 Int32

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

实现

异常

arraynullarray is null.

index 小于 0。index is less than 0.

array 是多维的。array is multidimensional.

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

注解

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

适用于