Ejemplo n.º 1
0
        public void Visit(IfThenElseBlockTag ifThenElseBlockTag)
        {
            // find the first place where the expression tree evaluates to true (i.e. which of the if/elsif/else clauses)
            // This ignores "eval" errors in clauses.

            var match = ifThenElseBlockTag.IfElseClauses.FirstOrDefault(
                expr => LiquidExpressionResultIsTrue(LiquidExpressionEvaluator.Eval(expr.LiquidExpressionTree, _templateContext)));

            if (match != null)
            {
                StartWalking(match.LiquidBlock); // then render the contents
            }
        }
Ejemplo n.º 2
0
 public void Visit(IfThenElseBlockTag ifThenElseBlockTag)
 {
     _result += ifThenElseBlockTag.ToString();
     _result += ifThenElseBlockTag.IfElseClauses.Select(x => VisitIfTag(x.LiquidExpressionTree));
 }