CompilerErrorCollection.CopyTo(CompilerError[], Int32) Méthode

Définition

Copie les valeurs de collection dans une instance unidimensionnelle Array à l’index spécifié.

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)

Paramètres

array
CompilerError[]

Unidimensionnel Array qui est la destination des valeurs copiées à partir de CompilerErrorCollection.

index
Int32

Index dans le tableau auquel commencer la copie.

Exceptions

Le tableau indiqué par le array paramètre est multidimensionnel.

- ou -

Le nombre d’éléments dans le tableau CompilerErrorCollection est supérieur à l’espace disponible entre index et la fin du tableau indiqué par array.

Le array paramètre est null.

Le index paramètre est inférieur à la limite inférieure du tableau indiqué par le array paramètre.

Exemples

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

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

S’applique à

Voir aussi