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

定義

從指定的陣列索引處開始,將 ICollection 的項目複製到陣列。Copies the elements of the ICollection to an array, starting at the specified 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

一維陣列,表示從這個 ICollection 複製過來之項目的目的地。The one-dimensional array that is the destination of the elements copied from the ICollection. 陣列必須有以零為起始的索引。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.

index 等於或大於的長度arrayindex is equal to or greater than the length of the array.

-或--or- 來源 ICollection 中的項目數目,大於 index 到目的 array 結尾的可用空間。The number of elements in the source ICollection is greater than the available space from index to the end of the destination array.

適用於

另請參閱