Expression.Catch 方法

定義

建立代表 catch 陳述式的 CatchBlock

多載

Catch(ParameterExpression, Expression)

建立 CatchBlock,代表包含已攔截 Exception 物件參考的 catch 陳述式,以便用於處理常式主體。

Catch(Type, Expression)

建立代表 catch 陳述式的 CatchBlock

Catch(ParameterExpression, Expression, Expression)

建立 CatchBlock,代表包含 Exception 篩選條件和已攔截 Exception 物件參考的 catch 陳述式。

Catch(Type, Expression, Expression)

建立 CatchBlock,代表包含 Exception 篩選條件但沒有已攔截 Exception 物件參考的 catch 陳述式。

Catch(ParameterExpression, Expression)

來源:
CatchBlock.cs
來源:
CatchBlock.cs
來源:
CatchBlock.cs

建立 CatchBlock,代表包含已攔截 Exception 物件參考的 catch 陳述式,以便用於處理常式主體。

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

參數

variable
ParameterExpression

ParameterExpression,代表這個處理常式所攔截 Exception 物件的參考。

body
Expression

catch 陳述式的主體。

傳回

建立的 CatchBlock

適用於

Catch(Type, Expression)

來源:
CatchBlock.cs
來源:
CatchBlock.cs
來源:
CatchBlock.cs

建立代表 catch 陳述式的 CatchBlock

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

參數

type
Type

這個 Type 將處理之 ExceptionCatchBlock

body
Expression

catch 陳述式的主體。

傳回

建立的 CatchBlock

備註

Type可以指定要攔截的 Exception ,但對象沒有參考Exception可供在 中使用CatchBlock

適用於

Catch(ParameterExpression, Expression, Expression)

來源:
CatchBlock.cs
來源:
CatchBlock.cs
來源:
CatchBlock.cs

建立 CatchBlock,代表包含 Exception 篩選條件和已攔截 Exception 物件參考的 catch 陳述式。

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

參數

variable
ParameterExpression

ParameterExpression,代表這個處理常式所攔截 Exception 物件的參考。

body
Expression

catch 陳述式的主體。

filter
Expression

Exception 篩選條件的主體。

傳回

建立的 CatchBlock

適用於

Catch(Type, Expression, Expression)

來源:
CatchBlock.cs
來源:
CatchBlock.cs
來源:
CatchBlock.cs

建立 CatchBlock,代表包含 Exception 篩選條件但沒有已攔截 Exception 物件參考的 catch 陳述式。

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

參數

type
Type

這個 Type 將處理之 ExceptionCatchBlock

body
Expression

catch 陳述式的主體。

filter
Expression

Exception 篩選條件的主體。

傳回

建立的 CatchBlock

適用於