Bagikan melalui


CodeCatchClauseCollection.AddRange Metode

Definisi

Menyalin elemen array yang ditentukan CodeCatchClause ke akhir koleksi.

Overload

AddRange(CodeCatchClause[])

Menyalin elemen array yang ditentukan CodeCatchClause ke akhir koleksi.

AddRange(CodeCatchClauseCollection)

Menyalin isi objek lain CodeCatchClauseCollection ke akhir koleksi.

AddRange(CodeCatchClause[])

Sumber:
CodeCatchClauseCollection.cs
Sumber:
CodeCatchClauseCollection.cs
Sumber:
CodeCatchClauseCollection.cs

Menyalin elemen array yang ditentukan CodeCatchClause ke akhir koleksi.

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

Parameter

value
CodeCatchClause[]

Array jenis CodeCatchClause yang berisi objek untuk ditambahkan ke koleksi.

Pengecualian

valueadalah null.

Contoh

Contoh berikut menunjukkan cara menggunakan AddRange(CodeCatchClause[]) metode kelebihan beban untuk menambahkan anggota array CodeCatchClause objek ke CodeCatchClauseCollection.

// Adds an array of CodeCatchClause objects to the collection.
array<CodeCatchClause^>^clauses = {gcnew CodeCatchClause,gcnew CodeCatchClause};
collection->AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection^ clausesCollection = gcnew CodeCatchClauseCollection;
clausesCollection->Add( gcnew CodeCatchClause( "e",gcnew CodeTypeReference( System::ArgumentOutOfRangeException::typeid ) ) );
clausesCollection->Add( gcnew CodeCatchClause( "e" ) );
collection->AddRange( clausesCollection );
// Adds an array of CodeCatchClause objects to the collection.
CodeCatchClause[] clauses = { new CodeCatchClause(), new CodeCatchClause() };
collection.AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection clausesCollection = new CodeCatchClauseCollection();
clausesCollection.Add( new CodeCatchClause("e", new CodeTypeReference(typeof(System.ArgumentOutOfRangeException))) );
clausesCollection.Add( new CodeCatchClause("e") );
collection.AddRange( clausesCollection );
' Adds an array of CodeCatchClause objects to the collection.
Dim clauses As CodeCatchClause() = {New CodeCatchClause(), New CodeCatchClause()}
collection.AddRange(clauses)

' Adds a collection of CodeCatchClause objects to the collection.
Dim clausesCollection As New CodeCatchClauseCollection()
clausesCollection.Add(New CodeCatchClause("e", New CodeTypeReference(GetType(System.ArgumentOutOfRangeException))))
clausesCollection.Add(New CodeCatchClause("e"))
collection.AddRange(clausesCollection)

Lihat juga

Berlaku untuk

AddRange(CodeCatchClauseCollection)

Sumber:
CodeCatchClauseCollection.cs
Sumber:
CodeCatchClauseCollection.cs
Sumber:
CodeCatchClauseCollection.cs

Menyalin isi objek lain CodeCatchClauseCollection ke akhir koleksi.

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

Parameter

value
CodeCatchClauseCollection

CodeCatchClauseCollection yang berisi objek untuk ditambahkan ke koleksi.

Pengecualian

valueadalah null.

Contoh

Contoh berikut menunjukkan cara menggunakan AddRange(CodeCatchClauseCollection) metode kelebihan beban untuk menambahkan anggota satu CodeCatchClauseCollection objek ke objek lainnya CodeCatchClauseCollection.

// Adds an array of CodeCatchClause objects to the collection.
array<CodeCatchClause^>^clauses = {gcnew CodeCatchClause,gcnew CodeCatchClause};
collection->AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection^ clausesCollection = gcnew CodeCatchClauseCollection;
clausesCollection->Add( gcnew CodeCatchClause( "e",gcnew CodeTypeReference( System::ArgumentOutOfRangeException::typeid ) ) );
clausesCollection->Add( gcnew CodeCatchClause( "e" ) );
collection->AddRange( clausesCollection );
// Adds an array of CodeCatchClause objects to the collection.
CodeCatchClause[] clauses = { new CodeCatchClause(), new CodeCatchClause() };
collection.AddRange( clauses );

// Adds a collection of CodeCatchClause objects to the collection.
CodeCatchClauseCollection clausesCollection = new CodeCatchClauseCollection();
clausesCollection.Add( new CodeCatchClause("e", new CodeTypeReference(typeof(System.ArgumentOutOfRangeException))) );
clausesCollection.Add( new CodeCatchClause("e") );
collection.AddRange( clausesCollection );
' Adds an array of CodeCatchClause objects to the collection.
Dim clauses As CodeCatchClause() = {New CodeCatchClause(), New CodeCatchClause()}
collection.AddRange(clauses)

' Adds a collection of CodeCatchClause objects to the collection.
Dim clausesCollection As New CodeCatchClauseCollection()
clausesCollection.Add(New CodeCatchClause("e", New CodeTypeReference(GetType(System.ArgumentOutOfRangeException))))
clausesCollection.Add(New CodeCatchClause("e"))
collection.AddRange(clausesCollection)

Lihat juga

Berlaku untuk