Upraviť

Zdieľať cez


SortedDictionary<TKey,TValue>.ValueCollection.CopyTo Method

Definition

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

public:
 virtual void CopyTo(cli::array <TValue> ^ array, int index);
public void CopyTo (TValue[] array, int index);
abstract member CopyTo : 'Value[] * int -> unit
override this.CopyTo : 'Value[] * int -> unit
Public Sub CopyTo (array As TValue(), index As Integer)

Parameters

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

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

Implements

Exceptions

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.

Remarks

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.

Applies to

See also