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.

Exception Condition
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.
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 );

.NET Framework
Available since 1.1
Return to top
Show: