Expression.MakeCatchBlock 方法

定义

创建一个表示具有指定元素的 catch 语句的 CatchBlock

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

参数

type
Type

Type 将处理的 ExceptionCatchBlock

variable
ParameterExpression

一个 ParameterExpression,它表示对此处理程序捕获的 Exception 对象的引用。

body
Expression

catch 语句的主体。

filter
Expression

Exception 筛选器的主体。

返回

创建的 CatchBlock

注解

type 如果) 提供 (类型 variable ,则必须为非 null 且匹配。

适用于