コード例 #1
0
        ForEachExpression ILexicalScope <ForEachExpression, Action <MemberExpression, LoopContext> > .Build(Action <MemberExpression, LoopContext> scope)
        {
            var result = new ForEachExpression(collection, cancellationToken, configureAwait, ContinueLabel, BreakLabel);

            using (var context = new LoopContext(result))
                scope(result.Element, context);
            result.Body = Build();
            return(result);
        }
コード例 #2
0
        WhileExpression ILexicalScope <WhileExpression, Action <LoopContext> > .Build(Action <LoopContext> scope)
        {
            var result = new WhileExpression(condition, ContinueLabel, BreakLabel, conditionFirst);

            using (var context = new LoopContext(result))
                scope(context);
            result.Body = Build();
            return(result);
        }
コード例 #3
0
        ForExpression ILexicalScope <ForExpression, Action <ParameterExpression, LoopContext> > .Build(Action <ParameterExpression, LoopContext> scope)
        {
            var result = new ForExpression(initialization, ContinueLabel, BreakLabel, condition);

            using (var context = new LoopContext(result))
                scope(result.LoopVar, context);
            AddStatement(Expression.Label(result.ContinueLabel));
            iteration(result.LoopVar);
            result.Body = Build();
            return(result);
        }
コード例 #4
0
 LoopExpression ILexicalScope <LoopExpression, Action <LoopContext> > .Build(Action <LoopContext> scope)
 {
     using (var context = new LoopContext(this))
         scope(context);
     return(Expression.Loop(Build(), BreakLabel, ContinueLabel));
 }