ReadOnlyDictionary<TKey,TValue>.ICollection<KeyValuePair<TKey,TValue>>.CopyTo Método

Definición

Copia los elementos del diccionario en una matriz, empezando por el índice de matriz especificado.

 virtual void System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo(cli::array <System::Collections::Generic::KeyValuePair<TKey, TValue>> ^ array, int arrayIndex) = System::Collections::Generic::ICollection<System::Collections::Generic::KeyValuePair<TKey, TValue>>::CopyTo;
void ICollection<KeyValuePair<TKey,TValue>>.CopyTo(System.Collections.Generic.KeyValuePair<TKey,TValue>[] array, int arrayIndex);
abstract member System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo : System.Collections.Generic.KeyValuePair<'Key, 'Value>[] * int -> unit
override this.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey,TValue>>.CopyTo : System.Collections.Generic.KeyValuePair<'Key, 'Value>[] * int -> unit
Sub CopyTo (array As KeyValuePair(Of TKey, TValue)(), arrayIndex As Integer) Implements ICollection(Of KeyValuePair(Of TKey, TValue)).CopyTo

Parámetros

array
KeyValuePair<TKey,TValue>[]

Matriz unidimensional que es el destino de los elementos copiados del diccionario. La matriz debe tener una indexación basada en cero.

arrayIndex
Int32

Índice de base cero en el array que comienza la copia.

Implementaciones

Excepciones

array es null.

arrayIndex es menor que 0.

array es multidimensional.

O bien

El número de elementos del diccionario de origen es mayor que el espacio disponible desde arrayIndex hasta el final del destino array.

O bien

El tipo T no se puede convertir automáticamente en el tipo del destino array.

Se aplica a