CodeAttributeArgumentCollection.AddRange Metod
Definition
Viktigt
En del information gäller för förhandsversionen av en produkt och kan komma att ändras avsevärt innan produkten blir allmänt tillgänglig. Microsoft lämnar inga garantier, uttryckliga eller underförstådda, avseende informationen som visas här.
Kopierar elementen i den angivna CodeAttributeArgument matrisen till slutet av samlingen.
Överlagringar
| Name | Description |
|---|---|
| AddRange(CodeAttributeArgument[]) |
Kopierar elementen i den angivna CodeAttributeArgument matrisen till slutet av samlingen. |
| AddRange(CodeAttributeArgumentCollection) |
Kopierar innehållet i ett annat CodeAttributeArgumentCollection objekt till slutet av samlingen. |
AddRange(CodeAttributeArgument[])
Kopierar elementen i den angivna CodeAttributeArgument matrisen till slutet av samlingen.
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())
Parametrar
- value
- CodeAttributeArgument[]
En matris av typen CodeAttributeArgument som innehåller de objekt som ska läggas till i samlingen.
Undantag
value är null.
Exempel
I följande exempel visas hur du använder metodöverlagringen AddRange(CodeAttributeArgument[]) för att lägga till medlemmar i en CodeAttributeArgument matris i en 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)
Se även
Gäller för
AddRange(CodeAttributeArgumentCollection)
Kopierar innehållet i ett annat CodeAttributeArgumentCollection objekt till slutet av samlingen.
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)
Parametrar
En CodeAttributeArgumentCollection som innehåller de objekt som ska läggas till i samlingen.
Undantag
value är null.
Exempel
I följande exempel visas hur du använder metodöverlagringen AddRange(CodeAttributeArgumentCollection) för att lägga till medlemmar i ett objekt till ett CodeAttributeArgumentCollection annat 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)