다음을 통해 공유


CodeTypeMemberCollection.AddRange 메서드

정의

컬렉션의 끝에 CodeTypeMember 개체를 추가합니다.

오버로드

AddRange(CodeTypeMember[])

지정된 CodeTypeMember 배열의 요소를 컬렉션의 끝에 복사합니다.

AddRange(CodeTypeMemberCollection)

다른 CodeTypeMemberCollection의 내용을 컬렉션의 끝에 추가합니다.

AddRange(CodeTypeMember[])

Source:
CodeTypeMemberCollection.cs
Source:
CodeTypeMemberCollection.cs
Source:
CodeTypeMemberCollection.cs

지정된 CodeTypeMember 배열의 요소를 컬렉션의 끝에 복사합니다.

public:
 void AddRange(cli::array <System::CodeDom::CodeTypeMember ^> ^ value);
public void AddRange (System.CodeDom.CodeTypeMember[] value);
member this.AddRange : System.CodeDom.CodeTypeMember[] -> unit
Public Sub AddRange (value As CodeTypeMember())

매개 변수

value
CodeTypeMember[]

컬렉션에 추가할 개체를 포함하는 CodeTypeMember 형식의 배열입니다.

예외

value이(가) null인 경우

예제

다음 예제에서는 두 AddRange 메서드 오버로드를 사용하여 배열의 멤버를 개체에 CodeTypeMemberCollection 추가하고 서로 CodeTypeMemberCollection 의 멤버를 추가하는 방법을 보여 줍니다.

// 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 );
// Adds an array of CodeTypeMember objects to the collection.
CodeTypeMember[] members = { new CodeMemberField("System.String", "TestStringField1"), new CodeMemberField("System.String", "TestStringField2") };
collection.AddRange( members );

// Adds a collection of CodeTypeMember objects to the collection.
CodeTypeMemberCollection membersCollection = new CodeTypeMemberCollection();
membersCollection.Add( new CodeMemberField("System.String", "TestStringField1") );
membersCollection.Add( new CodeMemberField("System.String", "TestStringField2") );
collection.AddRange( membersCollection );
' Adds an array of CodeTypeMember objects to the collection.
Dim members As CodeTypeMember() = {New CodeMemberField("System.String", "TestStringField1"), New CodeMemberField("System.String", "TestStringField2")}
collection.AddRange(members)

' Adds a collection of CodeTypeMember objects to the collection.
Dim membersCollection As New CodeTypeMemberCollection()
membersCollection.Add(New CodeMemberField("System.String", "TestStringField1"))
membersCollection.Add(New CodeMemberField("System.String", "TestStringField2"))
collection.AddRange(membersCollection)

추가 정보

적용 대상

AddRange(CodeTypeMemberCollection)

Source:
CodeTypeMemberCollection.cs
Source:
CodeTypeMemberCollection.cs
Source:
CodeTypeMemberCollection.cs

다른 CodeTypeMemberCollection의 내용을 컬렉션의 끝에 추가합니다.

public:
 void AddRange(System::CodeDom::CodeTypeMemberCollection ^ value);
public void AddRange (System.CodeDom.CodeTypeMemberCollection value);
member this.AddRange : System.CodeDom.CodeTypeMemberCollection -> unit
Public Sub AddRange (value As CodeTypeMemberCollection)

매개 변수

value
CodeTypeMemberCollection

컬렉션에 추가할 개체를 포함하는 CodeTypeMemberCollection입니다.

예외

value이(가) null인 경우

예제

다음 코드 예제에서는 두 AddRange 메서드 오버로드를 사용하여 배열의 멤버를 개체에 CodeTypeMemberCollection 추가하고 서로 CodeTypeMemberCollection 의 멤버를 추가하는 방법을 보여 줍니다.

// 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 );
// Adds an array of CodeTypeMember objects to the collection.
CodeTypeMember[] members = { new CodeMemberField("System.String", "TestStringField1"), new CodeMemberField("System.String", "TestStringField2") };
collection.AddRange( members );

// Adds a collection of CodeTypeMember objects to the collection.
CodeTypeMemberCollection membersCollection = new CodeTypeMemberCollection();
membersCollection.Add( new CodeMemberField("System.String", "TestStringField1") );
membersCollection.Add( new CodeMemberField("System.String", "TestStringField2") );
collection.AddRange( membersCollection );
' Adds an array of CodeTypeMember objects to the collection.
Dim members As CodeTypeMember() = {New CodeMemberField("System.String", "TestStringField1"), New CodeMemberField("System.String", "TestStringField2")}
collection.AddRange(members)

' Adds a collection of CodeTypeMember objects to the collection.
Dim membersCollection As New CodeTypeMemberCollection()
membersCollection.Add(New CodeMemberField("System.String", "TestStringField1"))
membersCollection.Add(New CodeMemberField("System.String", "TestStringField2"))
collection.AddRange(membersCollection)

추가 정보

적용 대상