CodeAttributeArgumentCollection::AddRange Method (array<CodeAttributeArgument^>^)

 

Copies the elements of the specified CodeAttributeArgument array to the end of the collection.

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

public:
void AddRange(
	array<CodeAttributeArgument^>^ value
)

Parameters

value
Type: array<System.CodeDom::CodeAttributeArgument^>^

An array of type CodeAttributeArgument that contains the objects to add to the collection.

Exception Condition
ArgumentNullException

value is null.

The following example demonstrates how to use the AddRange(array<CodeAttributeArgument^>^) method overload to add the members of a CodeAttributeArgument array to a 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: