CodeCatchClauseCollection.AddRange Método

Definição

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

Sobrecargas

Nome Description
AddRange(CodeCatchClause[])

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

AddRange(CodeCatchClauseCollection)

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

AddRange(CodeCatchClause[])

Copia os elementos da matriz especificada CodeCatchClause para o final 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 de 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 do 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.
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)

Copia o conteúdo de outro CodeCatchClauseCollection objeto 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 do AddRange(CodeCatchClauseCollection) método para adicionar os membros de um CodeCatchClauseCollection objeto a outro CodeCatchClauseCollection.

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