CodeAttributeArgumentCollection.AddRange Metodo

Definizione

Copia gli elementi della matrice di oggetti CodeAttributeArgument specificata alla fine dell'insieme.

Overload

AddRange(CodeAttributeArgument[])

Copia gli elementi della matrice di oggetti CodeAttributeArgument specificata alla fine dell'insieme.

AddRange(CodeAttributeArgumentCollection)

Copia il contenuto di un altro oggetto CodeAttributeArgumentCollection alla fine dell'insieme.

AddRange(CodeAttributeArgument[])

Origine:
CodeAttributeArgumentCollection.cs
Origine:
CodeAttributeArgumentCollection.cs
Origine:
CodeAttributeArgumentCollection.cs

Copia gli elementi della matrice di oggetti CodeAttributeArgument specificata alla fine dell'insieme.

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

Parametri

value
CodeAttributeArgument[]

Matrice di tipo CodeAttributeArgument contenente gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come usare l'overload del AddRange(CodeAttributeArgument[]) metodo per aggiungere i membri di una CodeAttributeArgument matrice a un oggetto CodeAttributeArgumentCollection.

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

// Adds a collection of CodeAttributeArgument objects to 
// the collection.
CodeAttributeArgumentCollection^ argumentsCollection = gcnew CodeAttributeArgumentCollection;
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestBooleanArgument",gcnew CodePrimitiveExpression( true ) ) );
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestIntArgument",gcnew CodePrimitiveExpression( 1 ) ) );
collection->AddRange( argumentsCollection );
// Adds an array of CodeAttributeArgument objects to the collection.
CodeAttributeArgument[] arguments = { new CodeAttributeArgument(), new CodeAttributeArgument() };
collection.AddRange( arguments );

// Adds a collection of CodeAttributeArgument objects to
// the collection.
CodeAttributeArgumentCollection argumentsCollection = new CodeAttributeArgumentCollection();
argumentsCollection.Add( new CodeAttributeArgument("TestBooleanArgument", new CodePrimitiveExpression(true)) );
argumentsCollection.Add( new CodeAttributeArgument("TestIntArgument", new CodePrimitiveExpression(1)) );
collection.AddRange( argumentsCollection );
' Adds an array of CodeAttributeArgument objects to the collection.
Dim arguments As CodeAttributeArgument() = {New CodeAttributeArgument(), New CodeAttributeArgument()}
collection.AddRange(arguments)

' Adds a collection of CodeAttributeArgument objects to the collection.
Dim argumentsCollection As New CodeAttributeArgumentCollection()
argumentsCollection.Add(New CodeAttributeArgument("TestBooleanArgument", New CodePrimitiveExpression(True)))
argumentsCollection.Add(New CodeAttributeArgument("TestIntArgument", New CodePrimitiveExpression(1)))
collection.AddRange(argumentsCollection)

Vedi anche

Si applica a

AddRange(CodeAttributeArgumentCollection)

Origine:
CodeAttributeArgumentCollection.cs
Origine:
CodeAttributeArgumentCollection.cs
Origine:
CodeAttributeArgumentCollection.cs

Copia il contenuto di un altro oggetto CodeAttributeArgumentCollection alla fine dell'insieme.

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

Parametri

value
CodeAttributeArgumentCollection

Oggetto CodeAttributeArgumentCollection che contiene gli oggetti da aggiungere all'insieme.

Eccezioni

value è null.

Esempio

Nell'esempio seguente viene illustrato come utilizzare l'overload del AddRange(CodeAttributeArgumentCollection) metodo per aggiungere i membri di un CodeAttributeArgumentCollection oggetto a un altro CodeAttributeArgumentCollectionoggetto .

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

// Adds a collection of CodeAttributeArgument objects to 
// the collection.
CodeAttributeArgumentCollection^ argumentsCollection = gcnew CodeAttributeArgumentCollection;
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestBooleanArgument",gcnew CodePrimitiveExpression( true ) ) );
argumentsCollection->Add( gcnew CodeAttributeArgument( "TestIntArgument",gcnew CodePrimitiveExpression( 1 ) ) );
collection->AddRange( argumentsCollection );
// Adds an array of CodeAttributeArgument objects to the collection.
CodeAttributeArgument[] arguments = { new CodeAttributeArgument(), new CodeAttributeArgument() };
collection.AddRange( arguments );

// Adds a collection of CodeAttributeArgument objects to
// the collection.
CodeAttributeArgumentCollection argumentsCollection = new CodeAttributeArgumentCollection();
argumentsCollection.Add( new CodeAttributeArgument("TestBooleanArgument", new CodePrimitiveExpression(true)) );
argumentsCollection.Add( new CodeAttributeArgument("TestIntArgument", new CodePrimitiveExpression(1)) );
collection.AddRange( argumentsCollection );
' Adds an array of CodeAttributeArgument objects to the collection.
Dim arguments As CodeAttributeArgument() = {New CodeAttributeArgument(), New CodeAttributeArgument()}
collection.AddRange(arguments)

' Adds a collection of CodeAttributeArgument objects to the collection.
Dim argumentsCollection As New CodeAttributeArgumentCollection()
argumentsCollection.Add(New CodeAttributeArgument("TestBooleanArgument", New CodePrimitiveExpression(True)))
argumentsCollection.Add(New CodeAttributeArgument("TestIntArgument", New CodePrimitiveExpression(1)))
collection.AddRange(argumentsCollection)

Vedi anche

Si applica a