Expression.MakeCatchBlock(Type, ParameterExpression, Expression, Expression) 方法
定义
创建一个表示具有指定元素的 catch 语句的 CatchBlock。Creates a CatchBlock representing a catch statement with the specified elements.
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 将处理的 Exception 的 CatchBlock。The Type of Exception this CatchBlock will handle.
- variable
- ParameterExpression
一个 ParameterExpression,它表示对此处理程序捕获的 Exception 对象的引用。A ParameterExpression representing a reference to the Exception object caught by this handler.
- body
- Expression
catch 语句的主体。The body of the catch statement.
- filter
- Expression
返回
创建的 CatchBlock。The created CatchBlock.
注解
type 如果) 提供,则必须为非 null,并且匹配 (的类型 variable 。type must be non-null and match the type of variable (if it is supplied).