Partager via


CodeTypeDeclarationCollection.AddRange Méthode

Définition

Copie les éléments du tableau spécifié à la fin de la collection.

Surcharges

AddRange(CodeTypeDeclaration[])

Copie les éléments du tableau spécifié à la fin de la collection.

AddRange(CodeTypeDeclarationCollection)

Ajoute le contenu d'un autre objet CodeTypeDeclarationCollection à la fin de la collection.

AddRange(CodeTypeDeclaration[])

Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs

Copie les éléments du tableau spécifié à la fin de la collection.

public:
 void AddRange(cli::array <System::CodeDom::CodeTypeDeclaration ^> ^ value);
public void AddRange (System.CodeDom.CodeTypeDeclaration[] value);
member this.AddRange : System.CodeDom.CodeTypeDeclaration[] -> unit
Public Sub AddRange (value As CodeTypeDeclaration())

Paramètres

value
CodeTypeDeclaration[]

Tableau de type CodeTypeDeclaration qui contient les objets à ajouter à la collection.

Exceptions

value a la valeur null.

Exemples

L’exemple suivant montre comment utiliser la surcharge de AddRange(CodeTypeDeclaration[]) méthode pour ajouter un tableau d’objets CodeTypeDeclaration à un CodeTypeDeclarationCollection.

// Adds an array of CodeTypeDeclaration objects to the collection.
array<CodeTypeDeclaration^>^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
collection->AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the 
// collection.
CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeTypeDeclaration objects to the collection.
CodeTypeDeclaration[] declarations = { new CodeTypeDeclaration("TestType1"), new CodeTypeDeclaration("TestType2") };
collection.AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the
// collection.
CodeTypeDeclarationCollection declarationsCollection = new CodeTypeDeclarationCollection();
declarationsCollection.Add( new CodeTypeDeclaration("TestType1") );
declarationsCollection.Add( new CodeTypeDeclaration("TestType2") );
collection.AddRange( declarationsCollection );
' Adds an array of CodeTypeDeclaration objects to the 
' collection.
Dim declarations As CodeTypeDeclaration() = {New CodeTypeDeclaration("TestType1"), New CodeTypeDeclaration("TestType2")}
collection.AddRange(declarations)

' Adds a collection of CodeTypeDeclaration objects to the collection.
Dim declarationsCollection As New CodeTypeDeclarationCollection()
declarationsCollection.Add(New CodeTypeDeclaration("TestType1"))
declarationsCollection.Add(New CodeTypeDeclaration("TestType2"))
collection.AddRange(declarationsCollection)

Voir aussi

S’applique à

AddRange(CodeTypeDeclarationCollection)

Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs
Source:
CodeTypeDeclarationCollection.cs

Ajoute le contenu d'un autre objet CodeTypeDeclarationCollection à la fin de la collection.

public:
 void AddRange(System::CodeDom::CodeTypeDeclarationCollection ^ value);
public void AddRange (System.CodeDom.CodeTypeDeclarationCollection value);
member this.AddRange : System.CodeDom.CodeTypeDeclarationCollection -> unit
Public Sub AddRange (value As CodeTypeDeclarationCollection)

Paramètres

value
CodeTypeDeclarationCollection

Objet CodeTypeDeclarationCollection qui contient les objets à ajouter à la collection.

Exceptions

value a la valeur null.

Exemples

L’exemple suivant montre comment utiliser la surcharge de AddRange(CodeTypeDeclarationCollection) méthode pour ajouter CodeTypeDeclaration des objets de l’un à l’autre CodeTypeDeclarationCollectionCodeTypeDeclarationCollection.

// Adds an array of CodeTypeDeclaration objects to the collection.
array<CodeTypeDeclaration^>^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
collection->AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the 
// collection.
CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeTypeDeclaration objects to the collection.
CodeTypeDeclaration[] declarations = { new CodeTypeDeclaration("TestType1"), new CodeTypeDeclaration("TestType2") };
collection.AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the
// collection.
CodeTypeDeclarationCollection declarationsCollection = new CodeTypeDeclarationCollection();
declarationsCollection.Add( new CodeTypeDeclaration("TestType1") );
declarationsCollection.Add( new CodeTypeDeclaration("TestType2") );
collection.AddRange( declarationsCollection );
' Adds an array of CodeTypeDeclaration objects to the 
' collection.
Dim declarations As CodeTypeDeclaration() = {New CodeTypeDeclaration("TestType1"), New CodeTypeDeclaration("TestType2")}
collection.AddRange(declarations)

' Adds a collection of CodeTypeDeclaration objects to the collection.
Dim declarationsCollection As New CodeTypeDeclarationCollection()
declarationsCollection.Add(New CodeTypeDeclaration("TestType1"))
declarationsCollection.Add(New CodeTypeDeclaration("TestType2"))
collection.AddRange(declarationsCollection)

Voir aussi

S’applique à