MakeGoto() public static method

Creates a GotoExpression representing a jump of the specified GotoExpressionKind. The value passed to the label upon jumping can also be specified.
public static MakeGoto ( GotoExpressionKind kind, LabelTarget target, Expression value, Type type ) : GotoExpression
kind GotoExpressionKind The of the .
target LabelTarget The that the will jump to.
value Expression The value that will be passed to the associated label upon jumping.
type Type A to set the property equal to.
return GotoExpression
Ejemplo n.º 1
0
 /// <summary>
 /// Creates a new expression that is like this one, but using the
 /// supplied children. If all of the children are the same, it will
 /// return this expression.
 /// </summary>
 /// <param name="target">The <see cref="Target"/> property of the result.</param>
 /// <param name="value">The <see cref="Value"/> property of the result.</param>
 /// <returns>This expression if no children changed, or an expression with the updated children.</returns>
 public GotoExpression Update(LabelTarget target, Expression value)
 {
     if (target == Target && value == Value)
     {
         return(this);
     }
     return(Expression.MakeGoto(Kind, target, value, Type));
 }
 public GotoExpression Update(LabelTarget target, Expression value)
 {
     if ((target == this.Target) && (value == this.Value))
     {
         return(this);
     }
     return(Expression.MakeGoto(this.Kind, target, value, this.Type));
 }
Ejemplo n.º 3
0
        protected internal virtual Expression VisitGoto(GotoExpression node)
        {
            LabelTarget t = VisitLabelTarget(node.Target);
            Expression  v = Visit(node.Value);

            if (t == node.Target && v == node.Value)
            {
                return(node);
            }
            return(Expression.MakeGoto(node.Kind, t, v));
        }