Expression.MakeGoto(GotoExpressionKind, LabelTarget, Expression, Type) 方法

定义

创建一个 GotoExpression,它表示指定的 GotoExpressionKind 的跳转。Creates a GotoExpression representing a jump of the specified GotoExpressionKind. 也可以指定在跳转时传递给标签的值。The value passed to the label upon jumping can also be specified.

public:
 static System::Linq::Expressions::GotoExpression ^ MakeGoto(System::Linq::Expressions::GotoExpressionKind kind, System::Linq::Expressions::LabelTarget ^ target, System::Linq::Expressions::Expression ^ value, Type ^ type);
public static System.Linq.Expressions.GotoExpression MakeGoto (System.Linq.Expressions.GotoExpressionKind kind, System.Linq.Expressions.LabelTarget target, System.Linq.Expressions.Expression value, Type type);
public static System.Linq.Expressions.GotoExpression MakeGoto (System.Linq.Expressions.GotoExpressionKind kind, System.Linq.Expressions.LabelTarget target, System.Linq.Expressions.Expression? value, Type type);
static member MakeGoto : System.Linq.Expressions.GotoExpressionKind * System.Linq.Expressions.LabelTarget * System.Linq.Expressions.Expression * Type -> System.Linq.Expressions.GotoExpression
Public Shared Function MakeGoto (kind As GotoExpressionKind, target As LabelTarget, value As Expression, type As Type) As GotoExpression

参数

target
LabelTarget

LabelTarget 将跳至的 GotoExpressionThe LabelTarget that the GotoExpression will jump to.

value
Expression

将在跳转时传递给关联标签的值。The value that will be passed to the associated label upon jumping.

type
Type

要将 Type 属性设置为与其相等的 TypeAn Type to set the Type property equal to.

返回

GotoExpression

一个 GotoExpression,其 Kind 等于 kind,其 Target 属性设置为 target,并且其 Type 属性设置为 type,此外还有一个在跳转时将传递给目标标签的 valueA GotoExpression with Kind equal to kind, the Target property set to target, the Type property set to type, and value to be passed to the target label upon jumping.

适用于