CodeParameterDeclarationExpressionCollection::AddRange Method (CodeParameterDeclarationExpressionCollection^)

 

Adds the contents of another CodeParameterDeclarationExpressionCollection to the end of the collection.

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

public:
void AddRange(
	CodeParameterDeclarationExpressionCollection^ value
)

Parameters

value
Type: System.CodeDom::CodeParameterDeclarationExpressionCollection^

A CodeParameterDeclarationExpressionCollection containing the objects to add to the collection.

Exception Condition
ArgumentNullException

value is null.

The following example demonstrates how to use the AddRange(CodeParameterDeclarationExpressionCollection^) method overload to add the members of one CodeParameterDeclarationExpressionCollection object to another CodeParameterDeclarationExpressionCollection.

// Adds an array of CodeParameterDeclarationExpression objects 
// to the collection.
array<CodeParameterDeclarationExpression^>^parameters = {gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ),gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" )};
collection->AddRange( parameters );

// Adds a collection of CodeParameterDeclarationExpression objects 
// to the collection.
CodeParameterDeclarationExpressionCollection^ parametersCollection = gcnew CodeParameterDeclarationExpressionCollection;
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( int::typeid,"testIntArgument" ) );
parametersCollection->Add( gcnew CodeParameterDeclarationExpression( bool::typeid,"testBoolArgument" ) );
collection->AddRange( parametersCollection );

.NET Framework
Available since 1.1
Return to top
Show: