Share via


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

Definição

Copia os valores da coleção para uma instância de Array unidimensional no í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[]

O Array unidimensional que é o destino dos valores copiados do CompilerErrorCollection.

index
Int32

O índice na matriz no qual iniciar a cópia.

Exceções

A matriz indicada pelo parâmetro array é multidimensional.

- ou -

O número de elementos na CompilerErrorCollection é maior do que o espaço disponível entre o valor do índice do parâmetro arrayIndex na matriz indicada pelo parâmetro array e o final da matriz indicada pelo parâmetro array.

O parâmetro array é null.

O parâmetro index é menor que o limite mínimo da matriz indicada pelo parâmetro array.

Exemplos

O exemplo a seguir demonstra como usar o CopyTo método para copiar o conteúdo de um para uma CompilerErrorCollection matriz, começando com o 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 );
' Copies the contents of the collection, beginning at index 0, 
' to the specified CompilerError array.
' 'errors' is a CompilerError array.
collection.CopyTo(errors, 0)

Aplica-se a

Confira também