CodeCatchClauseCollection.AddRange Método

Definición

Copia los elementos de la matriz CodeCatchClause especificada al final de la colección.

Sobrecargas

AddRange(CodeCatchClause[])

Copia los elementos de la matriz CodeCatchClause especificada al final de la colección.

AddRange(CodeCatchClauseCollection)

Copia el contenido de otro objeto CodeCatchClauseCollection al final de la colección.

AddRange(CodeCatchClause[])

Source:
CodeCatchClauseCollection.cs
Source:
CodeCatchClauseCollection.cs
Source:
CodeCatchClauseCollection.cs

Copia los elementos de la matriz CodeCatchClause especificada al final de la colección.

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[]

Matriz de tipo CodeCatchClause que contiene los objetos que se van a agregar a la colección.

Excepciones

value es null.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la sobrecarga del AddRange(CodeCatchClause[]) método para agregar los miembros de una matriz de CodeCatchClause objetos a 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)

Consulte también

Se aplica a

AddRange(CodeCatchClauseCollection)

Source:
CodeCatchClauseCollection.cs
Source:
CodeCatchClauseCollection.cs
Source:
CodeCatchClauseCollection.cs

Copia el contenido de otro objeto CodeCatchClauseCollection al final de la colección.

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

CodeCatchClauseCollection que contiene los objetos que se van a agregar a la colección.

Excepciones

value es null.

Ejemplos

En el ejemplo siguiente se muestra cómo usar la sobrecarga del AddRange(CodeCatchClauseCollection) método para agregar los miembros de un CodeCatchClauseCollection objeto a otro 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)

Consulte también

Se aplica a