Edit

Share via


ReadOnlyDictionary<K,V>.CopyTo(KeyValuePair<K,V>[], Int32) Method

Definition

Copies the elements of the ReadOnlyDictionary to an System.Array, starting at a particular System.Array index.

public:
 virtual void CopyTo(cli::array <System::Collections::Generic::KeyValuePair<K, V>> ^ array, int arrayIndex);
public void CopyTo (System.Collections.Generic.KeyValuePair<K,V>[] array, int arrayIndex);
abstract member CopyTo : System.Collections.Generic.KeyValuePair<'K, 'V>[] * int -> unit
override this.CopyTo : System.Collections.Generic.KeyValuePair<'K, 'V>[] * int -> unit
Public Sub CopyTo (array As KeyValuePair(Of K, V)(), arrayIndex As Integer)

Parameters

array
KeyValuePair<K,V>[]

The one-dimensional System.Array that is the destination of the elements copied from ReadOnlyDictionary. The System.Array must have zero-based indexing.

arrayIndex
Int32

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

Exceptions

Thrown when arrayIndex is less than 0.

Thrown when array is null.

Thrown when array is multidimensional, or when arrayIndex is greater than or equal to the length of array, or when the number of elements in the source ReadOnlyDictionalr is greater than the available space from arrayIndex to the end of the destination, or when Type T cannot be cast automatically to the type of the destination array.

Applies to