CodeCatchClauseCollection.AddRange Method

Definition

Copies the elements of the specified CodeCatchClause array to the end of the collection.

Overloads

AddRange(CodeCatchClause[])

Copies the elements of the specified CodeCatchClause array to the end of the collection.

AddRange(CodeCatchClauseCollection)

Copies the contents of another CodeCatchClauseCollection object to the end of the collection.

AddRange(CodeCatchClause[])

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

Copies the elements of the specified CodeCatchClause array to the end of the collection.

C#
public void AddRange(System.CodeDom.CodeCatchClause[] value);

Parameters

value
CodeCatchClause[]

An array of type CodeCatchClause that contains the objects to add to the collection.

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeCatchClause[]) method overload to add the members of an array of CodeCatchClause objects to the CodeCatchClauseCollection.

C#
// 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 );

See also

Applies to

.NET 10 (package-provided) i druge verzije
Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

AddRange(CodeCatchClauseCollection)

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

Copies the contents of another CodeCatchClauseCollection object to the end of the collection.

C#
public void AddRange(System.CodeDom.CodeCatchClauseCollection value);

Parameters

value
CodeCatchClauseCollection

A CodeCatchClauseCollection that contains the objects to add to the collection.

Exceptions

value is null.

Examples

The following example demonstrates how to use the AddRange(CodeCatchClauseCollection) method overload to add the members of one CodeCatchClauseCollection object to another CodeCatchClauseCollection.

C#
// 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 );

See also

Applies to

.NET 10 (package-provided) i druge verzije
Proizvod Verzije
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10