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

定義

從指定的陣列索引處開始,將字典的項目複製到陣列。Copies the elements of the dictionary to an array, starting at the specified array index.

 virtual void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(cli::array <System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ array, int arrayIndex) = 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 arrayIndex);
Sub CopyTo (array As KeyValuePair(Of TKey, TValue)(), arrayIndex As Integer) Implements ICollection(Of KeyValuePair(Of TKey, TValue)).CopyTo

參數

array
KeyValuePair<TKey,TValue>[]

從字典複製項目之目的地的一維陣列。The one-dimensional array that is the destination of the elements copied from the dictionary. 陣列必須有以零為起始的索引。The array must have zero-based indexing.

arrayIndex
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 dictionary 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.

適用於