CodeTypeDeclarationCollection.CopyTo(CodeTypeDeclaration[], Int32) Méthode

Définition

Copie les éléments de l'objet CodeTypeDeclarationCollection dans une instance Array unidimensionnelle, en commençant à l'index spécifié.

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

Paramètres

array
CodeTypeDeclaration[]

Array unidimensionnel qui représente la destination des valeurs copiées à partir de la collection.

index
Int32

Index du tableau à partir duquel commencer l'insertion.

Exceptions

Le tableau de destination est multidimensionnel.

- ou -

Le nombre d'éléments dans le CodeTypeDeclarationCollection est supérieur à l'espace disponible entre l'index du tableau cible spécifié par le paramètre index et la fin du tableau cible.

Le paramètre array a la valeur null.

Le paramètre index est inférieur à l'index minimal du tableau cible.

Exemples

L’exemple suivant montre comment utiliser la CopyTo méthode pour copier le contenu d’un CodeTypeDeclarationCollection objet dans un tableau, en commençant à la valeur d’index spécifiée.

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

S’applique à

Voir aussi