ConcurrentDictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.CopyTo 方法

定義

從指定的陣列索引處開始,將 ICollection 的項目複製到陣列。

 virtual void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(cli::array <System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ array, int index) = System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<TKey, TValue>>::CopyTo;
void ICollection<KeyValuePair<TKey,TValue>>.CopyTo (System.Collections.Generic.KeyValuePair<TKey,TValue>[] array, int index);
abstract member System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo : System.Collections.Generic.KeyValuePair<'Key, 'Value>[] * int -> unit
override this.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo : System.Collections.Generic.KeyValuePair<'Key, 'Value>[] * int -> unit
Sub CopyTo (array As KeyValuePair(Of TKey, TValue)(), index As Integer) Implements ICollection(Of KeyValuePair(Of TKey, TValue)).CopyTo

參數

array
KeyValuePair<TKey,TValue>[]

ICollection 複製的項目之目的地一維陣列。 陣列必須有以零為起始的索引。

index
Int32

array 中以零起始的索引,即開始複製的位置。

實作

例外狀況

arraynull

index 小於 0。

index 等於或大於 array 的長度。

-或-

來源 ICollection 中的項目數大於 index 到目的 array 結尾的可用空間。

適用於

另請參閱