CodeCatchClauseCollection.AddRange Metoda

Definice

Zkopíruje prvky zadaného CodeCatchClause pole na konec kolekce.

Přetížení

AddRange(CodeCatchClause[])

Zkopíruje prvky zadaného CodeCatchClause pole na konec kolekce.

AddRange(CodeCatchClauseCollection)

Zkopíruje obsah jiného CodeCatchClauseCollection objektu na konec kolekce.

AddRange(CodeCatchClause[])

Zdroj:
CodeCatchClauseCollection.cs
Zdroj:
CodeCatchClauseCollection.cs
Zdroj:
CodeCatchClauseCollection.cs

Zkopíruje prvky zadaného CodeCatchClause pole na konec kolekce.

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

Parametry

value
CodeCatchClause[]

Pole typu CodeCatchClause obsahující objekty, které se mají přidat do kolekce.

Výjimky

value je null.

Příklady

Následující příklad ukazuje, jak pomocí AddRange(CodeCatchClause[]) přetížení metody přidat členy pole CodeCatchClause objektů do 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)

Viz také

Platí pro

AddRange(CodeCatchClauseCollection)

Zdroj:
CodeCatchClauseCollection.cs
Zdroj:
CodeCatchClauseCollection.cs
Zdroj:
CodeCatchClauseCollection.cs

Zkopíruje obsah jiného CodeCatchClauseCollection objektu na konec kolekce.

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)

Parametry

value
CodeCatchClauseCollection

Objekt CodeCatchClauseCollection obsahující objekty, které se mají přidat do kolekce.

Výjimky

value je null.

Příklady

Následující příklad ukazuje, jak použít AddRange(CodeCatchClauseCollection) přetížení metody k přidání členů jednoho CodeCatchClauseCollection objektu do jiného 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)

Viz také

Platí pro