SortedDictionary<TKey, TValue>.ValueCollection.CopyTo Method

Copies the SortedDictionary<TKey, TValue>.ValueCollection elements to an existing one-dimensional array, starting at the specified array index.

Namespace:  System.Collections.Generic
Assemblies:   System.Collections (in System.Collections.dll)
  System (in System.dll)

public void CopyTo(
	TValue[] array,
	int index


Type: TValue[]

The one-dimensional array that is the destination of the elements copied from the SortedDictionary<TKey, TValue>.ValueCollection. The array must have zero-based indexing.

Type: System.Int32

The zero-based index in array at which copying begins.


ICollection<T>.CopyTo(T[], Int32)


array is null.


index is less than 0.


The number of elements in the source SortedDictionary<TKey, TValue>.ValueCollection 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<TKey, TValue>.ValueCollection.

This method is an O(n) operation, where n is Count.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft