CompilerErrorCollection.CopyTo(CompilerError[], Int32) Metod

Definition

Kopierar samlingsvärdena till en endimensionell Array instans vid det angivna indexet.

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)

Parametrar

array
CompilerError[]

Den endimensionella Array som är målet för de värden som kopieras från CompilerErrorCollection.

index
Int32

Indexet i matrisen där kopieringen ska börja.

Undantag

Matrisen som anges av parametern array är flerdimensionell.

-eller-

Antalet element i CompilerErrorCollection är större än det tillgängliga utrymmet mellan index och slutet av matrisen som anges av array.

Parametern array är null.

Parametern index är mindre än den nedre gränsen för matrisen som anges av parametern array .

Exempel

I följande exempel visas hur du använder CopyTo metoden för att kopiera innehållet i en till en CompilerErrorCollection matris, med början vid det angivna indexvärdet.

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

Gäller för

Se även