Export (0) Print
Expand All

CodeCatchClauseCollection.AddRange Method (CodeCatchClause[])

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

Namespace:  System.CodeDom
Assembly:  System (in System.dll)

public void AddRange(
	CodeCatchClause[] value


Type: System.CodeDom.CodeCatchClause[]

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


value is null.

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.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft