CompilerErrorCollection.CopyTo(CompilerError[], Int32) Método

Definición

Copia los valores de la colección en una instancia unidimensional Array en el índice especificado.

public:
 void CopyTo(cli::array <System::CodeDom::Compiler::CompilerError ^> ^ array, int index);
public void CopyTo(System.CodeDom.Compiler.CompilerError[] array, int index);
member this.CopyTo : System.CodeDom.Compiler.CompilerError[] * int -> unit
Public Sub CopyTo (array As CompilerError(), index As Integer)

Parámetros

array
CompilerError[]

Unidimensional Array que es el destino de los valores copiados de CompilerErrorCollection.

index
Int32

Índice de la matriz en la que se va a empezar a copiar.

Excepciones

La matriz indicada por el array parámetro es multidimensional.

O bien

El número de elementos de CompilerErrorCollection es mayor que el espacio disponible entre index y el final de la matriz indicado por array.

El array parámetro es null.

El index parámetro es menor que el límite inferior de la matriz indicado por el array parámetro .

Ejemplos

En el ejemplo siguiente se muestra cómo usar el CopyTo método para copiar el contenido de en CompilerErrorCollection una matriz, empezando por el valor de índice especificado.

// Copies the contents of the collection, beginning at index 0,
// to the specified CompilerError array.
// 'errors' is a CompilerError array.
collection.CopyTo( errors, 0 );
' Copies the contents of the collection, beginning at index 0, 
' to the specified CompilerError array.
' 'errors' is a CompilerError array.
collection.CopyTo(errors, 0)

Se aplica a

Consulte también