Expression.Catch Metod

Definition

Skapar en CatchBlock som representerar en catch-instruktion.

Överlagringar

Name Description
Catch(ParameterExpression, Expression)

Skapar en CatchBlock som representerar en catch-instruktion med en referens till det fångade Exception objektet för användning i hanterartexten.

Catch(Type, Expression)

Skapar en CatchBlock som representerar en catch-instruktion.

Catch(ParameterExpression, Expression, Expression)

Skapar en CatchBlock som representerar en catch-instruktion med ett Exception filter och en referens till det fångade Exception objektet.

Catch(Type, Expression, Expression)

Skapar en CatchBlock som representerar en catch-instruktion med ett Exception filter men ingen referens till det fångade Exception objektet.

Catch(ParameterExpression, Expression)

Skapar en CatchBlock som representerar en catch-instruktion med en referens till det fångade Exception objektet för användning i hanterartexten.

public:
 static System::Linq::Expressions::CatchBlock ^ Catch(System::Linq::Expressions::ParameterExpression ^ variable, System::Linq::Expressions::Expression ^ body);
public static System.Linq.Expressions.CatchBlock Catch(System.Linq.Expressions.ParameterExpression variable, System.Linq.Expressions.Expression body);
static member Catch : System.Linq.Expressions.ParameterExpression * System.Linq.Expressions.Expression -> System.Linq.Expressions.CatchBlock
Public Shared Function Catch (variable As ParameterExpression, body As Expression) As CatchBlock

Parametrar

variable
ParameterExpression

En ParameterExpression som representerar en referens till objektet som Exception fångas av den här hanteraren.

body
Expression

Brödtexten i catch-instruktionen.

Returer

Den skapade CatchBlock.

Gäller för

Catch(Type, Expression)

Skapar en CatchBlock som representerar en catch-instruktion.

public:
 static System::Linq::Expressions::CatchBlock ^ Catch(Type ^ type, System::Linq::Expressions::Expression ^ body);
public static System.Linq.Expressions.CatchBlock Catch(Type type, System.Linq.Expressions.Expression body);
static member Catch : Type * System.Linq.Expressions.Expression -> System.Linq.Expressions.CatchBlock
Public Shared Function Catch (type As Type, body As Expression) As CatchBlock

Parametrar

type
Type

Exception Av Type detta CatchBlock kommer att hantera.

body
Expression

Brödtexten i catch-instruktionen.

Returer

Den skapade CatchBlock.

Kommentarer

Av TypeException som ska fångas kan anges men ingen referens till Exception objektet kommer att vara tillgänglig för användning i CatchBlock.

Gäller för

Catch(ParameterExpression, Expression, Expression)

Skapar en CatchBlock som representerar en catch-instruktion med ett Exception filter och en referens till det fångade Exception objektet.

public:
 static System::Linq::Expressions::CatchBlock ^ Catch(System::Linq::Expressions::ParameterExpression ^ variable, System::Linq::Expressions::Expression ^ body, System::Linq::Expressions::Expression ^ filter);
public static System.Linq.Expressions.CatchBlock Catch(System.Linq.Expressions.ParameterExpression variable, System.Linq.Expressions.Expression body, System.Linq.Expressions.Expression filter);
static member Catch : System.Linq.Expressions.ParameterExpression * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.CatchBlock
Public Shared Function Catch (variable As ParameterExpression, body As Expression, filter As Expression) As CatchBlock

Parametrar

variable
ParameterExpression

En ParameterExpression som representerar en referens till objektet som Exception fångas av den här hanteraren.

body
Expression

Brödtexten i catch-instruktionen.

filter
Expression

Filtrets Exception brödtext.

Returer

Den skapade CatchBlock.

Gäller för

Catch(Type, Expression, Expression)

Skapar en CatchBlock som representerar en catch-instruktion med ett Exception filter men ingen referens till det fångade Exception objektet.

public:
 static System::Linq::Expressions::CatchBlock ^ Catch(Type ^ type, System::Linq::Expressions::Expression ^ body, System::Linq::Expressions::Expression ^ filter);
public static System.Linq.Expressions.CatchBlock Catch(Type type, System.Linq.Expressions.Expression body, System.Linq.Expressions.Expression filter);
static member Catch : Type * System.Linq.Expressions.Expression * System.Linq.Expressions.Expression -> System.Linq.Expressions.CatchBlock
Public Shared Function Catch (type As Type, body As Expression, filter As Expression) As CatchBlock

Parametrar

type
Type

Exception Av Type detta CatchBlock kommer att hantera.

body
Expression

Brödtexten i catch-instruktionen.

filter
Expression

Filtrets Exception brödtext.

Returer

Den skapade CatchBlock.

Gäller för