Export (0) Print
Expand All

CodeAttributeArgumentCollection.AddRange Method (CodeAttributeArgumentCollection)

Copies the contents of another CodeAttributeArgumentCollection object to the end of the collection.

Namespace:  System.CodeDom
Assembly:  System (in System.dll)

public void AddRange(
	CodeAttributeArgumentCollection value
)

Parameters

value
Type: System.CodeDom.CodeAttributeArgumentCollection

A CodeAttributeArgumentCollection that contains the objects to add to the collection.

ExceptionCondition
ArgumentNullException

value is null.

The following example demonstrates how to use the AddRange(CodeAttributeArgumentCollection) method overload to add the members of one CodeAttributeArgumentCollection object to another 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 );

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft