CodeCatchClauseCollection.AddRange Metod

Definition

Kopierar elementen i den angivna CodeCatchClause matrisen till slutet av samlingen.

Överlagringar

Name Description
AddRange(CodeCatchClause[])

Kopierar elementen i den angivna CodeCatchClause matrisen till slutet av samlingen.

AddRange(CodeCatchClauseCollection)

Kopierar innehållet i ett annat CodeCatchClauseCollection objekt till slutet av samlingen.

AddRange(CodeCatchClause[])

Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs

Kopierar elementen i den angivna CodeCatchClause matrisen till slutet av samlingen.

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

Parametrar

value
CodeCatchClause[]

En matris av typen CodeCatchClause som innehåller de objekt som ska läggas till i samlingen.

Undantag

value är null.

Exempel

I följande exempel visas hur du använder AddRange(CodeCatchClause[]) metodens överlagring för att lägga till medlemmar i en matris med CodeCatchClause objekt i 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)

Se även

Gäller för

AddRange(CodeCatchClauseCollection)

Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs
Källa:
CodeCatchClauseCollection.cs

Kopierar innehållet i ett annat CodeCatchClauseCollection objekt till slutet av samlingen.

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)

Parametrar

value
CodeCatchClauseCollection

En CodeCatchClauseCollection som innehåller de objekt som ska läggas till i samlingen.

Undantag

value är null.

Exempel

I följande exempel visas hur du använder metodöverlagringen AddRange(CodeCatchClauseCollection) för att lägga till medlemmar i ett objekt till ett CodeCatchClauseCollection annat 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)

Se även

Gäller för