Aracılığıyla paylaş


CodeTypeMemberCollection.AddRange Yöntem

Tanım

Koleksiyonun sonuna nesneleri ekler CodeTypeMember .

Aşırı Yüklemeler

AddRange(CodeTypeMember[])

Belirtilen CodeTypeMember dizinin öğelerini koleksiyonun sonuna kopyalar.

AddRange(CodeTypeMemberCollection)

Başka bir CodeTypeMemberCollection öğesinin içeriğini koleksiyonun sonuna ekler.

AddRange(CodeTypeMember[])

Kaynak:
CodeTypeMemberCollection.cs
Kaynak:
CodeTypeMemberCollection.cs
Kaynak:
CodeTypeMemberCollection.cs

Belirtilen CodeTypeMember dizinin öğelerini koleksiyonun sonuna kopyalar.

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())

Parametreler

value
CodeTypeMember[]

Koleksiyona eklenecek nesneleri içeren tür CodeTypeMember dizisi.

Özel durumlar

value, null değeridir.

Örnekler

Aşağıdaki örnekte, bir dizinin üyelerini bir nesneye eklemek ve birinin CodeTypeMemberCollection üyelerini diğerine eklemek için iki AddRange yöntem aşırı yüklemesinin CodeTypeMemberCollection nasıl kullanılacağı gösterilmektedir.

// 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)

Ayrıca bkz.

Şunlara uygulanır

AddRange(CodeTypeMemberCollection)

Kaynak:
CodeTypeMemberCollection.cs
Kaynak:
CodeTypeMemberCollection.cs
Kaynak:
CodeTypeMemberCollection.cs

Başka bir CodeTypeMemberCollection öğesinin içeriğini koleksiyonun sonuna ekler.

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)

Parametreler

value
CodeTypeMemberCollection

CodeTypeMemberCollection Koleksiyona eklenecek nesneleri içeren.

Özel durumlar

value, null değeridir.

Örnekler

Aşağıdaki kod örneği, bir dizinin üyelerini bir CodeTypeMemberCollection nesneye eklemek ve birinin üyelerini diğerine eklemek için iki AddRange yöntem aşırı yüklemesinin CodeTypeMemberCollection nasıl kullanılacağını gösterir.

// 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)

Ayrıca bkz.

Şunlara uygulanır