Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

SortedList<TKey, TValue>::ICollection<KeyValuePair<TKey, TValue>>::CopyTo Method (array<KeyValuePair<TKey, TValue>>^, Int32)

 

Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.

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

private:
virtual void CopyTo(
	array<KeyValuePair<TKey, TValue>>^ array,
	int arrayIndex
) sealed = ICollection<KeyValuePair<TKey, TValue>>::CopyTo

Parameters

array
Type: array<System.Collections.Generic::KeyValuePair<TKey, TValue>>^

The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing.

arrayIndex
Type: System::Int32

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

Exception Condition
ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than zero.

ArgumentException

The number of elements in the source ICollection<T> is greater than the available space from arrayIndex to the end of the destination array.

This method determines equality using the default comparer Default for KeyValuePair<TKey, TValue>.

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

Universal Windows Platform
Available since 10
.NET Framework
Available since 2.0
Return to top
Show:
© 2017 Microsoft