Exemplo n.º 1
0
        protected override Expression VisitStaticExpression(StaticExpression stex)
        {
            var encodedTextWriter = Expression.Property(CompilationContext.BindingContext, "TextWriter");
            var writeMethod       = typeof(EncodedTextWriter).GetMethod("Write", new [] { typeof(string), typeof(bool) });

            return(Expression.Call(encodedTextWriter, writeMethod, Expression.Constant(stex.Value), Expression.Constant(false)));
        }
Exemplo n.º 2
0
        protected override Expression VisitStaticExpression(StaticExpression stex)
        {
            var writer = CompilationContext.Args.EncodedWriter;
            var value  = Arg(stex.Value);

            return(writer.Call(o => o.Write(value, false)));
        }
Exemplo n.º 3
0
        protected override Expression VisitStaticExpression(StaticExpression stex)
        {
            var context = ExpressionShortcuts.Arg <BindingContext>(CompilationContext.BindingContext);
            var value   = ExpressionShortcuts.Arg(stex.Value);

            return(context.Call(o => o.TextWriter.Write(value, false)));
        }
Exemplo n.º 4
0
 protected override Expression VisitStaticExpression(StaticExpression stex)
 {
     var writeMethod = typeof(HandlebarsExtensions).GetMethod("WriteSafeString", new [] { typeof(TextWriter), typeof(string) });
     return Expression.Call(
         writeMethod,
         Expression.Property(
             CompilationContext.BindingContext,
             "TextWriter"),
         Expression.Constant(stex.Value));
 }
Exemplo n.º 5
0
        protected override Expression VisitStaticExpression(StaticExpression stex)
        {
	        var encodedTextWriter = Expression.Property(CompilationContext.BindingContext, "TextWriter");
#if netstandard
            var writeMethod = typeof(EncodedTextWriter).GetRuntimeMethod("Write", new [] { typeof(string), typeof(bool) });
#else
            var writeMethod = typeof(EncodedTextWriter).GetMethod("Write", new [] { typeof(string), typeof(bool) });
#endif

            return Expression.Call(encodedTextWriter, writeMethod, Expression.Constant(stex.Value), Expression.Constant(false));
        }
Exemplo n.º 6
0
        protected override Expression VisitStaticExpression(StaticExpression stex)
        {
            var writeMethod = typeof(HandlebarsExtensions).GetMethod("WriteSafeString", new [] { typeof(TextWriter), typeof(string) });

            return(Expression.Call(
                       writeMethod,
                       Expression.Property(
                           CompilationContext.BindingContext,
                           "TextWriter"),
                       Expression.Constant(stex.Value)));
        }
 protected virtual Expression VisitStaticExpression(StaticExpression stex)
 {
     return stex;
 }
 protected virtual Expression VisitStaticExpression(StaticExpression stex)
 {
     return(stex);
 }