The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
CodeTypeDeclarationCollection::AddRange Method (CodeTypeDeclarationCollection^)
.NET Framework (current version)
Adds the contents of another CodeTypeDeclarationCollection object to the end of the collection.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
System.CodeDom::CodeTypeDeclarationCollection^
A CodeTypeDeclarationCollection object that contains the objects to add to the collection.
| Exception | Condition |
|---|---|
| ArgumentNullException | value is null. |
The following example demonstrates how to use the AddRange(CodeTypeDeclarationCollection^) method overload to add CodeTypeDeclaration objects from one CodeTypeDeclarationCollection to another 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
Available since 1.1
Show: