Write() 공개 메소드

public Write ( string text ) : void
text string
리턴 void
예제 #1
1
        public override void Render(RenderContext context)
        {
            object value = context.GetValue(_name);

            if (value != null)
            {
                context.Write(value.ToString());
            }
        }
예제 #2
0
 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());
     }
 }
예제 #3
0
        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());
            }
        }
예제 #4
0
        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());
            }
        }
예제 #5
0
        public override void Render(RenderContext context)
        {
            object value = context.GetValue(_name);

            if (value != null)
            {
                context.Write(_escaped
                  ? HttpUtility.HtmlEncode( value.ToString())
                  : value.ToString());
            }
        }
예제 #6
0
        public override void Render(RenderContext context)
        {
            object value = context.GetValue(_path);

            if (value != null)
            {
                context.Write(_escaped
                    ? Encoders.HtmlEncode(value.ToString())
                    : value.ToString());
            }
        }
예제 #7
0
        public override void Render(RenderContext context)
        {
            object value = context.GetValue(_path);

            if (value != null)
            {
                context.Write(_escaped
                    ? Encoders.HtmlEncode(value.ToString())
                    : value.ToString());
            }
        }
예제 #8
0
        public override void Render(RenderContext context)
        {
            object value = context.GetValue(_name);

            if (value != null)
            {
                context.Write(_escaped
                ? HttpUtility.HtmlEncode(value.ToString())
                : value.ToString());
            }
        }
예제 #9
0
        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());
            }
        }
예제 #10
0
        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());
            }
        }
예제 #11
0
        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());
            }
        }
예제 #12
0
        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());
            }
        }
예제 #13
0
 public override void Render(RenderContext context)
 {
     context.Write(_text);
 }
예제 #14
0
 public override void Render(RenderContext context)
 {
     context.Write(_text);
 }
예제 #15
0
 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());
     }
 }