CodeAttributeArgumentCollection.AddRange Metoda

Definicja

Kopiuje elementy określonej CodeAttributeArgument tablicy na końcu kolekcji.

Przeciążenia

Nazwa Opis
AddRange(CodeAttributeArgument[])

Kopiuje elementy określonej CodeAttributeArgument tablicy na końcu kolekcji.

AddRange(CodeAttributeArgumentCollection)

Kopiuje zawartość innego CodeAttributeArgumentCollection obiektu na końcu kolekcji.

AddRange(CodeAttributeArgument[])

Kopiuje elementy określonej CodeAttributeArgument tablicy na końcu kolekcji.

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

Parametry

value
CodeAttributeArgument[]

Tablica typu CodeAttributeArgument zawierająca obiekty do dodania do kolekcji.

Wyjątki

Parametr value ma wartość null.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą AddRange(CodeAttributeArgument[]) przeciążenia metody dodać elementy członkowskie CodeAttributeArgument tablicy do CodeAttributeArgumentCollectionobiektu .

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

Zobacz też

Dotyczy

AddRange(CodeAttributeArgumentCollection)

Kopiuje zawartość innego CodeAttributeArgumentCollection obiektu na końcu kolekcji.

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)

Parametry

value
CodeAttributeArgumentCollection

Obiekt CodeAttributeArgumentCollection zawierający obiekty do dodania do kolekcji.

Wyjątki

Parametr value ma wartość null.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą AddRange(CodeAttributeArgumentCollection) przeciążenia metody dodać elementy członkowskie jednego CodeAttributeArgumentCollection obiektu do innego CodeAttributeArgumentCollectionobiektu .

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

Zobacz też

Dotyczy