Expression.MakeCatchBlock 方法

定义

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

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

Exception这将Type处理。CatchBlock

variable
ParameterExpression

表示 ParameterExpression 对此处理程序捕获的对象的引用 Exception

body
Expression

catch 语句的正文。

filter
Expression

筛选器的 Exception 正文。

返回

创建的 CatchBlock

注解

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

适用于