CodeTypeDeclarationCollection::AddRange Method (array<CodeTypeDeclaration^>^)

 

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

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

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

Parameters

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

An array of type CodeTypeDeclaration 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<CodeTypeDeclaration^>^) method overload to add an array of CodeTypeDeclaration objects to a CodeTypeDeclarationCollection.

// Adds an array of CodeTypeDeclaration objects to the collection.
array<CodeTypeDeclaration^>^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
collection->AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the 
// collection.
CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
collection->AddRange( declarationsCollection );

.NET Framework
Available since 1.1
Return to top
Show: