示例#1
0
 public override string Render(TemplateItem item)
 {
     var evaluation = new ExpressionEvaluator(item).Evaluate(Expression);
     return EachValueOf(evaluation)
         .Aggregate(new StringBuilder(), (s, t) => s.Append(Content.Render(t)))
         .ToString();
 }
示例#2
0
        public override string Render(TemplateItem item)
        {
            var enumerable = item.Data as IEnumerable;
            
            if(enumerable == null)
                return Content.Render(item);

            return enumerable.Cast<object>()
                .Aggregate(new StringBuilder(), (sb, obj) => { item.Data = obj; return sb.Append(Content.Render(item)); })
                .ToString();
        }
 public override string Render(TemplateItem item)
 {
     return _children
         .Aggregate(new StringBuilder(), (sb, t) => sb.Append(t.Render(item)))
         .ToString();
 }
 public EvaluatedExpression(TemplateItem item, object value)
 {
     _item = item;
     _value = value;
 }
示例#5
0
 public override string Render(TemplateItem item)
 {
     return HttpUtility.HtmlEncode(new ExpressionEvaluator(item).Evaluate(Expression));
 }
 public ExpressionEvaluator(TemplateItem item)
 {
     _item = item;
 }