CodeAttributeDeclarationCollection.AddRange Metodo

Definizione

Copia gli elementi della matrice di oggetti CodeAttributeDeclaration specificata alla fine dell'insieme.Copies the elements of the specified CodeAttributeDeclaration array to the end of the collection.

Overload

AddRange(CodeAttributeDeclaration[])

Copia gli elementi della matrice di oggetti CodeAttributeDeclaration specificata alla fine dell'insieme.Copies the elements of the specified CodeAttributeDeclaration array to the end of the collection.

AddRange(CodeAttributeDeclarationCollection)

Copia il contenuto di un altro oggetto CodeAttributeDeclarationCollection alla fine dell'insieme.Copies the contents of another CodeAttributeDeclarationCollection object to the end of the collection.

AddRange(CodeAttributeDeclaration[])

Copia gli elementi della matrice di oggetti CodeAttributeDeclaration specificata alla fine dell'insieme.Copies the elements of the specified CodeAttributeDeclaration array to the end of the 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())

Parametri

value
CodeAttributeDeclaration[]

Matrice di tipo CodeAttributeDeclaration contenente gli oggetti da aggiungere all'insieme.An array of type CodeAttributeDeclaration that contains the objects to add to the collection.

Eccezioni

value è null.value is null.

Esempi

Nell'esempio seguente viene illustrato come utilizzare AddRange(CodeAttributeDeclaration[]) overload del metodo per aggiungere una matrice di oggetti CodeAttributeDeclaration a un CodeAttributeDeclarationCollection.The following example demonstrates how to use AddRange(CodeAttributeDeclaration[]) method overload to add an array of CodeAttributeDeclaration objects to a 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)

Vedi anche

AddRange(CodeAttributeDeclarationCollection)

Copia il contenuto di un altro oggetto CodeAttributeDeclarationCollection alla fine dell'insieme.Copies the contents of another CodeAttributeDeclarationCollection object to the end of the 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)

Parametri

value
CodeAttributeDeclarationCollection

Oggetto CodeAttributeDeclarationCollection che contiene gli oggetti da aggiungere all'insieme.A CodeAttributeDeclarationCollection that contains the objects to add to the collection.

Eccezioni

value è null.value is null.

Esempi

Nell'esempio seguente viene illustrato come utilizzare l'overload del metodo AddRange(CodeAttributeDeclarationCollection) per aggiungere i membri di un CodeAttributeDeclarationCollection a un altro.The following example demonstrates how to use the AddRange(CodeAttributeDeclarationCollection) method overload to add the members of one CodeAttributeDeclarationCollection to another.

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

Vedi anche

Si applica a