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

定義

從特定的 ICollection<T> 索引開始,將 Array 的項目複製到 ArrayCopies the elements of the ICollection<T> to an Array, starting at a particular 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>[]

一維 Array,是從 ICollection<T> 複製過來之項目的目的端。The one-dimensional Array that is the destination of the elements copied from ICollection<T>. Array 必須有以零為起始的索引。The Array must have zero-based indexing.

arrayIndex
Int32 Int32 Int32

array 中以零起始的索引,即開始複製的位置。The zero-based index in array at which copying begins.

例外狀況

arrayIndex 小於零。arrayIndex is less than zero.

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

適用於