CodeAttributeDeclarationCollection.CopyTo Metoda

Definice

Zkopíruje objekty kolekce do jednorozměrné Array instance počínaje zadaným indexem.

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)

Parametry

array
CodeAttributeDeclaration[]

Jednorozměrný Array , který je cílem hodnot zkopírovaných z kolekce.

index
Int32

Index pole, ve kterém se má začít vkládat.

Výjimky

Cílové pole je multidimenzionální.

-nebo-

Počet prvků v objektu CodeAttributeDeclarationCollection je větší než dostupná mezera mezi indexem cílového pole určeným parametrem index a koncem cílového pole.

Parametr array je null.

Parametr index je menší než minimální index cílového pole.

Příklady

Následující příklad ukazuje, jak zkopírovat obsah objektu CodeAttributeDeclarationCollection do pole začínajícího indexem 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 );
// 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)

Platí pro

Viz také