SortedDictionary(Of TKey, TValue).KeyCollection.CopyTo Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Copies the SortedDictionary(Of TKey, TValue).KeyCollection elements to an existing one-dimensional array, starting at the specified array index.
Assembly: System (in System.dll)
Parameters
- array
- Type:
TKey
()
The one-dimensional array that is the destination of the elements copied from the SortedDictionary(Of TKey, TValue).KeyCollection. The array must have zero-based indexing.
- index
- Type: System.Int32
The zero-based index in array at which copying begins.
Implements
ICollection(Of T).CopyTo(T(), Int32)| Exception | Condition |
|---|---|
| ArgumentNullException | array is Nothing. |
| ArgumentOutOfRangeException | index is less than 0. |
| ArgumentException | The number of elements in the source SortedDictionary(Of TKey, TValue).KeyCollection is greater than the available space from index to the end of the destination array. |
The elements are copied to the array in the same order in which the enumerator iterates through the SortedDictionary(Of TKey, TValue).KeyCollection.
This method is an O(n) operation, where n is Count.