Expression.Catch Methode

Definition

Erstellt einen CatchBlock, der eine Catch-Anweisung darstellt.

Überlädt

Catch(ParameterExpression, Expression)

Erstellt einen CatchBlock, der eine Catch-Anweisung mit einem Verweis auf das aufgefangene Exception-Objekt zur Verwendung im Handlertext darstellt.

Catch(Type, Expression)

Erstellt einen CatchBlock, der eine Catch-Anweisung darstellt.

Catch(ParameterExpression, Expression, Expression)

Erstellt einen CatchBlock, der eine Catch-Anweisung mit einem Exception-Filter und einem Verweis auf das aufgefangene Exception-Objekt darstellt.

Catch(Type, Expression, Expression)

Erstellt einen CatchBlock, der eine Catch-Anweisung mit einem Exception-Filter, aber keinem Verweis auf das aufgefangene Exception-Objekt darstellt.

Catch(ParameterExpression, Expression)

Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs

Erstellt einen CatchBlock, der eine Catch-Anweisung mit einem Verweis auf das aufgefangene Exception-Objekt zur Verwendung im Handlertext darstellt.

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

Parameter

variable
ParameterExpression

Eine ParameterExpression, die einen Verweis auf das von diesem Handler aufgefangene Exception-Objekt darstellt.

body
Expression

Der Text der Catch-Anweisung.

Gibt zurück

Der erstellte CatchBlock.

Gilt für:

Catch(Type, Expression)

Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs

Erstellt einen CatchBlock, der eine Catch-Anweisung darstellt.

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

Parameter

type
Type

Der Type von Exception, der von diesem CatchBlock behandelt wird.

body
Expression

Der Text der Catch-Anweisung.

Gibt zurück

Der erstellte CatchBlock.

Hinweise

Der Type von, der Exception abgefangen werden soll, kann angegeben werden, aber es steht kein Verweis auf das Exception -Objekt zur Verwendung in der CatchBlockzur Verfügung.

Gilt für:

Catch(ParameterExpression, Expression, Expression)

Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs

Erstellt einen CatchBlock, der eine Catch-Anweisung mit einem Exception-Filter und einem Verweis auf das aufgefangene Exception-Objekt darstellt.

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

Parameter

variable
ParameterExpression

Eine ParameterExpression, die einen Verweis auf das von diesem Handler aufgefangene Exception-Objekt darstellt.

body
Expression

Der Text der Catch-Anweisung.

filter
Expression

Der Text des Exception-Filters.

Gibt zurück

Der erstellte CatchBlock.

Gilt für:

Catch(Type, Expression, Expression)

Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs
Quelle:
CatchBlock.cs

Erstellt einen CatchBlock, der eine Catch-Anweisung mit einem Exception-Filter, aber keinem Verweis auf das aufgefangene Exception-Objekt darstellt.

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

Parameter

type
Type

Der Type von Exception, der von diesem CatchBlock behandelt wird.

body
Expression

Der Text der Catch-Anweisung.

filter
Expression

Der Text des Exception-Filters.

Gibt zurück

Der erstellte CatchBlock.

Gilt für: