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.
CodeCatchClauseCollection::AddRange Method (CodeCatchClauseCollection^)
.NET Framework (current version)
Copies the contents of another CodeCatchClauseCollection object to the end of the collection.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
System.CodeDom::CodeCatchClauseCollection^
A CodeCatchClauseCollection that contains the objects to add to the collection.
| Exception | Condition |
|---|---|
| ArgumentNullException | value is null. |
The following example demonstrates how to use the AddRange(CodeCatchClauseCollection^) method overload to add the members of one CodeCatchClauseCollection object to another CodeCatchClauseCollection.
// Adds an array of CodeCatchClause objects to the collection. array<CodeCatchClause^>^clauses = {gcnew CodeCatchClause,gcnew CodeCatchClause}; collection->AddRange( clauses ); // Adds a collection of CodeCatchClause objects to the collection. CodeCatchClauseCollection^ clausesCollection = gcnew CodeCatchClauseCollection; clausesCollection->Add( gcnew CodeCatchClause( "e",gcnew CodeTypeReference( System::ArgumentOutOfRangeException::typeid ) ) ); clausesCollection->Add( gcnew CodeCatchClause( "e" ) ); collection->AddRange( clausesCollection );
.NET Framework
Available since 1.1
Available since 1.1
Show: