CodeCatchClauseCollection.AddRange Méthode

Définition

Copie les éléments du tableau CodeCatchClause spécifié à la fin de la collection.

Surcharges

AddRange(CodeCatchClause[])

Copie les éléments du tableau CodeCatchClause spécifié à la fin de la collection.

AddRange(CodeCatchClauseCollection)

Copie le contenu d'un autre objet CodeCatchClauseCollection à la fin de la collection.

AddRange(CodeCatchClause[])

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

Copie les éléments du tableau CodeCatchClause spécifié à la fin de la collection.

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

Paramètres

value
CodeCatchClause[]

Tableau de type CodeCatchClause qui contient les objets à ajouter à la collection.

Exceptions

value a la valeur null.

Exemples

L’exemple suivant montre comment utiliser la AddRange(CodeCatchClause[]) surcharge de méthode pour ajouter les membres d’un tableau d’objets CodeCatchClause au 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)

Voir aussi

S’applique à

AddRange(CodeCatchClauseCollection)

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

Copie le contenu d'un autre objet CodeCatchClauseCollection à la fin de la collection.

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)

Paramètres

value
CodeCatchClauseCollection

CodeCatchClauseCollection qui contient les objets à ajouter à la collection.

Exceptions

value a la valeur null.

Exemples

L’exemple suivant montre comment utiliser la surcharge de AddRange(CodeCatchClauseCollection) méthode pour ajouter les membres d’un CodeCatchClauseCollection objet à un autre 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)

Voir aussi

S’applique à