CodeCatchClauseCollection.CopyTo(CodeCatchClause[], Int32) Metódus

Definíció

A gyűjteményobjektumokat a megadott indextől kezdődő egydimenziós Array példányba másolja.

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

Paraméterek

array
CodeCatchClause[]

A gyűjteményből másolt értékek célhelye egydimenziós Array .

index
Int32

Annak a tömbnek az indexe, amelybe a beszúrást el kell kezdeni.

Kivételek

A céltömb többdimenziós.

-vagy-

A benne lévő CodeCatchClauseCollection elemek száma nagyobb, mint a paraméter által index megadott céltömb indexe és a céltömb vége közötti szabad terület.

A array paraméter a következő null: .

A index paraméter kisebb, mint a céltömb minimális indexe.

Példák

Az alábbi példa bemutatja, hogyan másolhatja egy tömb tartalmát CodeCatchClauseCollection egy CodeCatchClause 0 indexértéktől kezdődő tömbbe.

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

A következőre érvényes:

Lásd még