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
)

Parameters

array
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.

index
Type: System.Int32

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

Implements

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

ExceptionCondition
ArgumentNullException

array is null.

ArgumentOutOfRangeException

index is less than 0.

ArgumentException

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
Show:
© 2015 Microsoft