Compartilhar via


CodeCatchClauseCollection.AddRange Método

Definição

Copia os elementos da matriz CodeCatchClause especificada para o fim da coleção.

Sobrecargas

AddRange(CodeCatchClause[])

Copia os elementos da matriz CodeCatchClause especificada para o fim da coleção.

AddRange(CodeCatchClauseCollection)

Copia o conteúdo de outro objeto CodeCatchClauseCollection para o final da coleção.

AddRange(CodeCatchClause[])

Origem:
CodeCatchClauseCollection.cs
Origem:
CodeCatchClauseCollection.cs
Origem:
CodeCatchClauseCollection.cs

Copia os elementos da matriz CodeCatchClause especificada para o fim da coleção.

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

Parâmetros

value
CodeCatchClause[]

Uma matriz do tipo CodeCatchClause que contém os objetos a serem adicionados à coleção.

Exceções

value é null.

Exemplos

O exemplo a seguir demonstra como usar a sobrecarga de AddRange(CodeCatchClause[]) método para adicionar os membros de uma matriz de CodeCatchClause objetos ao 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)

Confira também

Aplica-se a

AddRange(CodeCatchClauseCollection)

Origem:
CodeCatchClauseCollection.cs
Origem:
CodeCatchClauseCollection.cs
Origem:
CodeCatchClauseCollection.cs

Copia o conteúdo de outro objeto CodeCatchClauseCollection para o final da coleção.

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)

Parâmetros

value
CodeCatchClauseCollection

Um CodeCatchClauseCollection que contém os objetos a serem adicionados à coleção.

Exceções

value é null.

Exemplos

O exemplo a seguir demonstra como usar a sobrecarga de AddRange(CodeCatchClauseCollection) método para adicionar os membros de um CodeCatchClauseCollection objeto a outro 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)

Confira também

Aplica-se a