CompilerErrorCollection.CopyTo(CompilerError[], Int32) Metodo

Definizione

Copia i valori dell'insieme in un'istanza di un oggetto Array unidimensionale in corrispondenza dell'indice specificato.

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)

Parametri

array
CompilerError[]

Istanza unidimensionale di Array destinazione dei valori copiati da CompilerErrorCollection.

index
Int32

Indice nella matrice in corrispondenza della quale iniziare a eseguire la copia.

Eccezioni

La matrice indicata dal parametro array è multidimensionale.

-oppure-

Il numero degli elementi dell'oggetto CompilerErrorCollection è maggiore dello spazio disponibile tra il valore di indice del parametro arrayIndex della matrice indicata dal parametro array e la fine della matrice indicata dal parametro array.

Il valore del parametro array è null.

Il parametro index è minore del limite inferiore della matrice indicata dal parametro array.

Esempio

Nell'esempio seguente viene illustrato come utilizzare il CopyTo metodo per copiare il contenuto di un oggetto in una CompilerErrorCollection matrice, a partire dal valore di indice specificato.

// 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)

Si applica a

Vedi anche