CodeParameterDeclarationExpressionCollection.AddRange Method (CodeParameterDeclarationExpression[])


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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

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

public void AddRange(
	CodeParameterDeclarationExpression[] value


Type: System.CodeDom.CodeParameterDeclarationExpression[]

An array of type CodeParameterDeclarationExpression containing the objects to add to the collection.

Exception Condition

value is null.

The following example demonstrates how to use the AddRange(CodeParameterDeclarationExpression[]) method overload to add the members of a CodeParameterDeclarationExpression array to a CodeParameterDeclarationExpressionCollection.

// Adds an array of CodeParameterDeclarationExpression objects 
// to the collection.
CodeParameterDeclarationExpression[] parameters = { new CodeParameterDeclarationExpression(typeof(int), "testIntArgument"), new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") };
collection.AddRange( parameters );

// Adds a collection of CodeParameterDeclarationExpression objects 
// to the collection.
CodeParameterDeclarationExpressionCollection parametersCollection = new CodeParameterDeclarationExpressionCollection();
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(int), "testIntArgument") );
parametersCollection.Add( new CodeParameterDeclarationExpression(typeof(bool), "testBoolArgument") );
collection.AddRange( parametersCollection );

.NET Framework
Available since 1.1
Return to top