CodeCatchClauseCollection.AddRange Methode

Definitie

Kopieert de elementen van de opgegeven CodeCatchClause matrix naar het einde van de verzameling.

Overloads

Name Description
AddRange(CodeCatchClause[])

Kopieert de elementen van de opgegeven CodeCatchClause matrix naar het einde van de verzameling.

AddRange(CodeCatchClauseCollection)

Hiermee kopieert u de inhoud van een ander CodeCatchClauseCollection object naar het einde van de verzameling.

AddRange(CodeCatchClause[])

Kopieert de elementen van de opgegeven CodeCatchClause matrix naar het einde van de verzameling.

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

Parameters

value
CodeCatchClause[]

Een matrix van het type CodeCatchClause dat de objecten bevat die aan de verzameling moeten worden toegevoegd.

Uitzonderingen

value is null.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de overbelasting van de AddRange(CodeCatchClause[]) methode gebruikt om de leden van een matrix met CodeCatchClause objecten toe te voegen aan de 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)

Zie ook

Van toepassing op

AddRange(CodeCatchClauseCollection)

Hiermee kopieert u de inhoud van een ander CodeCatchClauseCollection object naar het einde van de verzameling.

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)

Parameters

value
CodeCatchClauseCollection

Een CodeCatchClauseCollection met de objecten die moeten worden toegevoegd aan de verzameling.

Uitzonderingen

value is null.

Voorbeelden

In het volgende voorbeeld ziet u hoe u de overbelasting van de AddRange(CodeCatchClauseCollection) methode gebruikt om de leden van het ene CodeCatchClauseCollection object toe te voegen aan een ander CodeCatchClauseCollectionobject.

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

Zie ook

Van toepassing op