Windows apps
Collapse the table of content
Expand the table of content
Information
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.

CodeTypeMemberCollection::AddRange Method (CodeTypeMemberCollection^)

 

Adds the contents of another CodeTypeMemberCollection to the end of the collection.

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

public:
void AddRange(
	CodeTypeMemberCollection^ value
)

Parameters

value
Type: System.CodeDom::CodeTypeMemberCollection^

A CodeTypeMemberCollection containing the objects to add to the collection.

Exception Condition
ArgumentNullException

value is null.

The following code 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
Return to top
Show:
© 2017 Microsoft