public override void Render(RenderContext context) { object value = context.GetValue(_name); if (value != null) { context.Write(value.ToString()); } }
public static void FormatHelper( RenderContext ctx, IList<object> args, IDictionary<string, object> options, RenderBlock fn, RenderBlock inverse) { try { ctx.Write(FormatValue(args.FirstArg(), args.SecondStringArg())); } catch (Exception exception) { ctx.Write(exception.ToString()); } }
public override void Render(RenderContext context) { object value = context.GetValue(_path); if (value != null) { context.Write(_escaped ? Encoders.HtmlEncode(value.ToString()) : ReplaceLineBreaksAndEncode(value.ToString())); return; } if (context.CurrentOptions.PreserveUndefinedVariables && !context.PathExists(_path)) { context.Write(Source()); } }
public override void Render(RenderContext context) { object value = context.GetValue(_name); if (value != null) { context.Write(_escaped ? HttpUtility.HtmlEncode( value.ToString()) : value.ToString()); } }
public override void Render(RenderContext context) { object value = context.GetValue(_path); if (value != null) { context.Write(_escaped ? Encoders.HtmlEncode(value.ToString()) : value.ToString()); } }
public override void Render(RenderContext context) { object value = context.GetValue(_name); if (value != null) { context.Write(_escaped ? HttpUtility.HtmlEncode(value.ToString()) : value.ToString()); } }
public override void Render(RenderContext context) { var value = context.GetValue(_path); var helper = value as HelperProxy; if (helper != null) { helper(data => { }, data => { }); } else if (value != null) { context.Write(_escaped ? Encoders.HtmlEncode(value.ToString()) : value.ToString()); } }
public override void Render(RenderContext context) { var value = context.GetValue(_path); var lambda = CheckValueIsDelegateOrLambda(value); if (lambda != null) { var lambdaResult = lambda().ToString(); lambdaResult = _escaped ? Encoders.HtmlEncode(lambdaResult.ToString()) : lambdaResult.ToString(); using (System.IO.TextReader sr = new System.IO.StringReader(lambdaResult)) { Template template = new Template(); template.StartDelimiter = "{{"; template.EndDelimiter = "}}"; template.Load(sr); context.Enter(template); template.Render(context); context.Exit(); return; } } var helper = value as HelperProxy; if (helper != null) { helper(data => { }, data => { }); } else if (value != null) { context.Write(_escaped ? Encoders.HtmlEncode(value.ToString()) : value.ToString()); } }
public override void Render(RenderContext context) { var value = context.GetValue(_path); var lambda = CheckValueIsDelegateOrLambda(value); if(lambda != null) { var lambdaResult = lambda().ToString(); lambdaResult = _escaped ? Encoders.HtmlEncode(lambdaResult.ToString()) : lambdaResult.ToString(); using (System.IO.TextReader sr = new System.IO.StringReader(lambdaResult)) { Template template = new Template(); template.StartDelimiter = "{{"; template.EndDelimiter = "}}"; template.Load(sr); context.Enter(template); template.Render(context); context.Exit(); return; } } var helper = value as HelperProxy; if (helper != null) { helper(data => { }, data => { }); } else if (value != null) { context.Write(_escaped ? Encoders.HtmlEncode(value.ToString()) : value.ToString()); } }
public override void Render(RenderContext context) { context.Write(_text); }
public static void ReplaceHelper( RenderContext ctx, IList<object> args, IDictionary<string, object> options, RenderBlock fn, RenderBlock inverse) { try { ctx.Write(ReplaceValues(args)); } catch (Exception exception) { ctx.Write(exception.ToString()); } }