Partager via


CodeAttributeDeclarationCollection.AddRange Méthode

Définition

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

Surcharges

AddRange(CodeAttributeDeclaration[])

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

AddRange(CodeAttributeDeclarationCollection)

Copie le contenu d'un autre objet CodeAttributeDeclarationCollection à la fin de la collection.

AddRange(CodeAttributeDeclaration[])

Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs

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

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

Paramètres

value
CodeAttributeDeclaration[]

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

Exceptions

value a la valeur null.

Exemples

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

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

// Adds a collection of CodeAttributeDeclaration objects 
// to the collection.
CodeAttributeDeclarationCollection^ declarationsCollection = gcnew CodeAttributeDeclarationCollection;
array<CodeAttributeArgument^>^temp1 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp1 ) );
array<CodeAttributeArgument^>^temp2 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( true ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "BrowsableAttribute",temp2 ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclaration[] declarations = { new CodeAttributeDeclaration(), new CodeAttributeDeclaration() };
collection.AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclarationCollection declarationsCollection = new CodeAttributeDeclarationCollection();
declarationsCollection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
declarationsCollection.Add( new CodeAttributeDeclaration("BrowsableAttribute", new CodeAttributeArgument(new CodePrimitiveExpression(true))) );
collection.AddRange( declarationsCollection );
' Adds an array of CodeAttributeDeclaration objects to the collection.
Dim declarations As CodeAttributeDeclaration() = {New CodeAttributeDeclaration(), New CodeAttributeDeclaration()}
collection.AddRange(declarations)

' Adds a collection of CodeAttributeDeclaration objects to 
' the collection.
Dim declarationsCollection As New CodeAttributeDeclarationCollection()
declarationsCollection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
declarationsCollection.Add(New CodeAttributeDeclaration("BrowsableAttribute", New CodeAttributeArgument(New CodePrimitiveExpression(True))))
collection.AddRange(declarationsCollection)

Voir aussi

S’applique à

AddRange(CodeAttributeDeclarationCollection)

Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs
Source:
CodeAttributeDeclarationCollection.cs

Copie le contenu d'un autre objet CodeAttributeDeclarationCollection à la fin de la collection.

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

Paramètres

value
CodeAttributeDeclarationCollection

CodeAttributeDeclarationCollection qui contient les objets à ajouter à la collection.

Exceptions

value a la valeur null.

Exemples

L’exemple suivant montre comment utiliser la surcharge de AddRange(CodeAttributeDeclarationCollection) méthode pour ajouter les membres de l’un à l’autre CodeAttributeDeclarationCollection .

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

// Adds a collection of CodeAttributeDeclaration objects 
// to the collection.
CodeAttributeDeclarationCollection^ declarationsCollection = gcnew CodeAttributeDeclarationCollection;
array<CodeAttributeArgument^>^temp1 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( "Test Description" ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "DescriptionAttribute",temp1 ) );
array<CodeAttributeArgument^>^temp2 = {gcnew CodeAttributeArgument( gcnew CodePrimitiveExpression( true ) )};
declarationsCollection->Add( gcnew CodeAttributeDeclaration( "BrowsableAttribute",temp2 ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclaration[] declarations = { new CodeAttributeDeclaration(), new CodeAttributeDeclaration() };
collection.AddRange( declarations );

// Adds a collection of CodeAttributeDeclaration objects
// to the collection.
CodeAttributeDeclarationCollection declarationsCollection = new CodeAttributeDeclarationCollection();
declarationsCollection.Add( new CodeAttributeDeclaration("DescriptionAttribute", new CodeAttributeArgument(new CodePrimitiveExpression("Test Description"))) );
declarationsCollection.Add( new CodeAttributeDeclaration("BrowsableAttribute", new CodeAttributeArgument(new CodePrimitiveExpression(true))) );
collection.AddRange( declarationsCollection );
' Adds an array of CodeAttributeDeclaration objects to the collection.
Dim declarations As CodeAttributeDeclaration() = {New CodeAttributeDeclaration(), New CodeAttributeDeclaration()}
collection.AddRange(declarations)

' Adds a collection of CodeAttributeDeclaration objects to 
' the collection.
Dim declarationsCollection As New CodeAttributeDeclarationCollection()
declarationsCollection.Add(New CodeAttributeDeclaration("DescriptionAttribute", New CodeAttributeArgument(New CodePrimitiveExpression("Test Description"))))
declarationsCollection.Add(New CodeAttributeDeclaration("BrowsableAttribute", New CodeAttributeArgument(New CodePrimitiveExpression(True))))
collection.AddRange(declarationsCollection)

Voir aussi

S’applique à