ICollection.CopyTo(Array, Int32) Método
Definición
Copia los elementos de ICollection en Array, empezando por un índice determinado de Array.Copies the elements of the ICollection to an Array, starting at a particular Array index.
public:
void CopyTo(Array ^ array, int index);
public void CopyTo (Array array, int index);
abstract member CopyTo : Array * int -> unit
Public Sub CopyTo (array As Array, index As Integer)
Parámetros
- array
- Array
Array unidimensional que constituye el destino de los elementos copiados de ICollection.The one-dimensional Array that is the destination of the elements copied from ICollection. La matriz Array debe tener una indización de base cero.The Array must have zero-based indexing.
- index
- Int32
Índice de base cero en la array
donde comienza la copia.The zero-based index in array
at which copying begins.
Excepciones
array
es null
.array
is null
.
index
es menor que cero.index
is less than zero.
array
es multidimensional.array
is multidimensional.
o bien-or-
El número de elementos de la ICollection de origen es mayor que el espacio disponible desde index
hasta el final de la array
de destino.The number of elements in the source ICollection is greater than the available space from index
to the end of the destination array
.
o bien-or-
El tipo de la ICollection de origen no puede convertirse automáticamente al tipo de la array
de destino.The type of the source ICollection cannot be cast automatically to the type of the destination array
.