Expression::TryCatchFinally Method (Expression^, Expression^, array<CatchBlock^>^)

 

Creates a TryExpression representing a try block with any number of catch statements and a finally block.

Namespace:   System.Linq.Expressions
Assembly:  System.Core (in System.Core.dll)

public:
static TryExpression^ TryCatchFinally(
	Expression^ body,
	Expression^ finally,
	... array<CatchBlock^>^ handlers
)

Parameters

body
Type: System.Linq.Expressions::Expression^

The body of the try block.

finally
Type: System.Linq.Expressions::Expression^

The body of the finally block.

handlers
Type: array<System.Linq.Expressions::CatchBlock^>^

The array of zero or more CatchBlock expressions representing the catch statements to be associated with the try block.

The following example demonstrates how to create a TryExpression object that contains a catch statement and a finally statement.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: