CodeAttributeArgumentCollection.AddRange Methode

Definitie

Kopieert de elementen van de opgegeven CodeAttributeArgument matrix naar het einde van de verzameling.

Overloads

Name Description
AddRange(CodeAttributeArgument[])

Kopieert de elementen van de opgegeven CodeAttributeArgument matrix naar het einde van de verzameling.

AddRange(CodeAttributeArgumentCollection)

Hiermee kopieert u de inhoud van een ander CodeAttributeArgumentCollection object naar het einde van de verzameling.

AddRange(CodeAttributeArgument[])

Kopieert de elementen van de opgegeven CodeAttributeArgument matrix naar het einde van de verzameling.

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

Parameters

value
CodeAttributeArgument[]

Een matrix van het type CodeAttributeArgument dat de objecten bevat die aan de verzameling moeten worden toegevoegd.

Uitzonderingen

value is null.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de overbelasting van de AddRange(CodeAttributeArgument[]) methode gebruikt om de leden van een CodeAttributeArgument matrix toe te voegen aan een CodeAttributeArgumentCollection.

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

Zie ook

Van toepassing op

AddRange(CodeAttributeArgumentCollection)

Hiermee kopieert u de inhoud van een ander CodeAttributeArgumentCollection object naar het einde van de verzameling.

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)

Parameters

value
CodeAttributeArgumentCollection

Een CodeAttributeArgumentCollection met de objecten die moeten worden toegevoegd aan de verzameling.

Uitzonderingen

value is null.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de overbelasting van de AddRange(CodeAttributeArgumentCollection) methode gebruikt om de leden van het ene CodeAttributeArgumentCollection object toe te voegen aan een ander CodeAttributeArgumentCollectionobject.

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

Zie ook

Van toepassing op