ReadOnlyDictionary<TKey,TValue>.KeyCollection.ICollection.CopyTo 方法

定义

从特定的数组索引开始,将集合的元素复制到一个数组中。

 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

作为集合中元素的复制目标位置的一维数组。 该数组的索引必须从零开始。

index
Int32

array 中从零开始的索引,从此处开始复制。

实现

例外

arraynull

index 小于 0。

array 是多维的。

- 或 -

源集合中的元素数大于从 index 到目标 array 的末尾的可用空间。

注解

此成员是显式接口成员的实现。 它只能在 ReadOnlyDictionary<TKey,TValue>.KeyCollection 实例被强制转换为 ICollection 接口时使用。

适用于