CodeTypeMemberCollection::AddRange Method (array<CodeTypeMember^>^)
.NET Framework (current version)
Copies the elements of the specified CodeTypeMember array to the end of the collection.
Assembly: System (in System.dll)
Parameters
- value
-
Type:
array<System.CodeDom::CodeTypeMember^>^
An array of type CodeTypeMember containing the objects to add to the collection.
| Exception | Condition |
|---|---|
| ArgumentNullException | value is null. |
The following example demonstrates how to use the two AddRange method overloads to add the members of an array to a CodeTypeMemberCollection object, and to add the members of one CodeTypeMemberCollection to another.
// Adds an array of CodeTypeMember objects to the collection. array<CodeTypeMember^>^members = {gcnew CodeMemberField( "System.String","TestStringField1" ),gcnew CodeMemberField( "System.String","TestStringField2" )}; collection->AddRange( members ); // Adds a collection of CodeTypeMember objects to the collection. CodeTypeMemberCollection^ membersCollection = gcnew CodeTypeMemberCollection; membersCollection->Add( gcnew CodeMemberField( "System.String","TestStringField1" ) ); membersCollection->Add( gcnew CodeMemberField( "System.String","TestStringField2" ) ); collection->AddRange( membersCollection );
.NET Framework
Available since 1.1
Available since 1.1
Show: