Bagikan melalui


CodeTypeDeclarationCollection.AddRange Metode

Definisi

Menyalin elemen array yang ditentukan ke akhir koleksi.

Overload

AddRange(CodeTypeDeclaration[])

Menyalin elemen array yang ditentukan ke akhir koleksi.

AddRange(CodeTypeDeclarationCollection)

Menambahkan isi objek lain CodeTypeDeclarationCollection ke akhir koleksi.

AddRange(CodeTypeDeclaration[])

Sumber:
CodeTypeDeclarationCollection.cs
Sumber:
CodeTypeDeclarationCollection.cs
Sumber:
CodeTypeDeclarationCollection.cs

Menyalin elemen array yang ditentukan ke akhir koleksi.

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

Parameter

value
CodeTypeDeclaration[]

Array jenis CodeTypeDeclaration yang berisi objek untuk ditambahkan ke koleksi.

Pengecualian

valueadalah null.

Contoh

Contoh berikut menunjukkan cara menggunakan AddRange(CodeTypeDeclaration[]) metode kelebihan beban untuk menambahkan array CodeTypeDeclaration objek ke CodeTypeDeclarationCollection.

// Adds an array of CodeTypeDeclaration objects to the collection.
array<CodeTypeDeclaration^>^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
collection->AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the 
// collection.
CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeTypeDeclaration objects to the collection.
CodeTypeDeclaration[] declarations = { new CodeTypeDeclaration("TestType1"), new CodeTypeDeclaration("TestType2") };
collection.AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the
// collection.
CodeTypeDeclarationCollection declarationsCollection = new CodeTypeDeclarationCollection();
declarationsCollection.Add( new CodeTypeDeclaration("TestType1") );
declarationsCollection.Add( new CodeTypeDeclaration("TestType2") );
collection.AddRange( declarationsCollection );
' Adds an array of CodeTypeDeclaration objects to the 
' collection.
Dim declarations As CodeTypeDeclaration() = {New CodeTypeDeclaration("TestType1"), New CodeTypeDeclaration("TestType2")}
collection.AddRange(declarations)

' Adds a collection of CodeTypeDeclaration objects to the collection.
Dim declarationsCollection As New CodeTypeDeclarationCollection()
declarationsCollection.Add(New CodeTypeDeclaration("TestType1"))
declarationsCollection.Add(New CodeTypeDeclaration("TestType2"))
collection.AddRange(declarationsCollection)

Lihat juga

Berlaku untuk

AddRange(CodeTypeDeclarationCollection)

Sumber:
CodeTypeDeclarationCollection.cs
Sumber:
CodeTypeDeclarationCollection.cs
Sumber:
CodeTypeDeclarationCollection.cs

Menambahkan isi objek lain CodeTypeDeclarationCollection ke akhir koleksi.

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

Parameter

value
CodeTypeDeclarationCollection

Objek CodeTypeDeclarationCollection yang berisi objek yang akan ditambahkan ke koleksi.

Pengecualian

valueadalah null.

Contoh

Contoh berikut menunjukkan cara menggunakan AddRange(CodeTypeDeclarationCollection) metode kelebihan beban untuk menambahkan CodeTypeDeclaration objek dari satu CodeTypeDeclarationCollection ke objek lainnya CodeTypeDeclarationCollection.

// Adds an array of CodeTypeDeclaration objects to the collection.
array<CodeTypeDeclaration^>^declarations = {gcnew CodeTypeDeclaration( "TestType1" ),gcnew CodeTypeDeclaration( "TestType2" )};
collection->AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the 
// collection.
CodeTypeDeclarationCollection^ declarationsCollection = gcnew CodeTypeDeclarationCollection;
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType1" ) );
declarationsCollection->Add( gcnew CodeTypeDeclaration( "TestType2" ) );
collection->AddRange( declarationsCollection );
// Adds an array of CodeTypeDeclaration objects to the collection.
CodeTypeDeclaration[] declarations = { new CodeTypeDeclaration("TestType1"), new CodeTypeDeclaration("TestType2") };
collection.AddRange( declarations );

// Adds a collection of CodeTypeDeclaration objects to the
// collection.
CodeTypeDeclarationCollection declarationsCollection = new CodeTypeDeclarationCollection();
declarationsCollection.Add( new CodeTypeDeclaration("TestType1") );
declarationsCollection.Add( new CodeTypeDeclaration("TestType2") );
collection.AddRange( declarationsCollection );
' Adds an array of CodeTypeDeclaration objects to the 
' collection.
Dim declarations As CodeTypeDeclaration() = {New CodeTypeDeclaration("TestType1"), New CodeTypeDeclaration("TestType2")}
collection.AddRange(declarations)

' Adds a collection of CodeTypeDeclaration objects to the collection.
Dim declarationsCollection As New CodeTypeDeclarationCollection()
declarationsCollection.Add(New CodeTypeDeclaration("TestType1"))
declarationsCollection.Add(New CodeTypeDeclaration("TestType2"))
collection.AddRange(declarationsCollection)

Lihat juga

Berlaku untuk