System.Linq.Expressions.Expression.Label C# (CSharp) Method

Label() public static method

Creates a LabelExpression representing a label with no default value.
public static Label ( LabelTarget target ) : LabelExpression
target LabelTarget The which this will be associated with.
return LabelExpression
        public static LabelExpression Label(LabelTarget target)
        {
            return Label(target, defaultValue: null);
        }

Same methods

Expression::Label ( LabelTarget target, Expression defaultValue ) : LabelExpression
Expression::Label ( ) : LabelTarget
Expression::Label ( Type type ) : LabelTarget
Expression::Label ( Type type, string name ) : LabelTarget
Expression::Label ( string name ) : LabelTarget

Usage Example

Ejemplo n.º 1
0
        protected override object VisitDoWhile(DoWhile W)
        {
            string name = target.LabelName();

            LinqExprs.LabelTarget begin = LinqExpr.Label("do_" + name + "_begin");
            LinqExprs.LabelTarget end   = LinqExpr.Label("do_" + name + "_end");
            loops.Push(new Loop(LinqExpr.Goto(end), LinqExpr.Goto(begin)));

            target.PushScope();

            // Check the condition, exit if necessary.
            target.Add(LinqExpr.Label(begin));

            // Generate the body target.
            Visit(W.Body);

            // Loop.
            target.Add(LinqExpr.IfThen(target.Compile(W.Condition), LinqExpr.Goto(begin)));

            // Exit label.
            target.Add(LinqExpr.Label(end));

            loops.Pop();
            target.PopScope();
            return(null);
        }
All Usage Examples Of System.Linq.Expressions.Expression::Label
Expression