CodeAttributeDeclarationCollection.CopyTo 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::CodeAttributeDeclaration ^> ^ array, int index);
public void CopyTo(System.CodeDom.CodeAttributeDeclaration[] array, int index);
member this.CopyTo : System.CodeDom.CodeAttributeDeclaration[] * int -> unit
Public Sub CopyTo (array As CodeAttributeDeclaration(), index As Integer)

Paraméterek

array
CodeAttributeDeclaration[]

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ő CodeAttributeDeclarationCollection 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 CodeAttributeDeclarationCollection a 0. indextől kezdődő tömbbe.

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

A következőre érvényes:

Lásd még