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.
CodeStatementCollection::AddRange Method (array<CodeStatement^>^)
.NET Framework (current version)
Adds a set of CodeStatement objects to the collection.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
array<System.CodeDom::CodeStatement^>^
An array of CodeStatement objects to add to the collection.
| Exception | Condition |
|---|---|
| ArgumentNullException | value is null. |
The following example demonstrates how to use the AddRange(array<CodeStatement^>^) method overload to add the members of an array to a CodeStatementCollection instance.
// Adds an array of CodeStatement objects to the collection. array<CodeStatement^>^statements = {gcnew CodeCommentStatement( "Test comment statement" ),gcnew CodeCommentStatement( "Test comment statement" )}; collection->AddRange( statements ); // Adds a collection of CodeStatement objects to the collection. CodeStatement^ testStatement = gcnew CodeCommentStatement( "Test comment statement" ); CodeStatementCollection^ statementsCollection = gcnew CodeStatementCollection; statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) ); statementsCollection->Add( gcnew CodeCommentStatement( "Test comment statement" ) ); statementsCollection->Add( testStatement ); collection->AddRange( statementsCollection );
.NET Framework
Available since 1.1
Available since 1.1
Show: