Example #1
0
        public override void Write(TextWriter writer, Context context)
        {
            var value = context.GetValue(_expression);

            if (value.IsNullOrNoValue())
            {
                return;
            }
            writer.Write(Convert.ToString(value));
        }
Example #2
0
 public void CheckValueCaching()
 {
     const string name = "abc";
     var root = new Item(name);
     var context = new Context(root);
     for (int i = 0; i < 2; i++)
     {
         Assert.AreEqual(name, context.GetValue("Name"));
         Assert.AreEqual(1, root.NameCalls);
     }
 }
Example #3
0
 public override void Write(TextWriter writer, Context context)
 {
     if (context.GetValue(_expression).IsFalse())
     {
         _content.Write(writer, context);
     }
     else
     {
         _else.Write(writer, context);
     }
 }
Example #4
0
 public override void Write(TextWriter writer, Context context)
 {
     if (context.GetValue(_expression).IsFalse())
     {
         _content.Write(writer, context);
     }
     else
     {
         _else.Write(writer, context);
     }
 }
Example #5
0
        public override void Write(TextWriter writer, Context context)
        {
            var value = context.GetValue(_expression);
            if (value.IsNullOrNoValue()) return;

            try
            {
                context.Push(value, null);
                _content.Write(writer, context);
            }
            catch (Exception)
            {
                context.Pop();
            }
        }
Example #6
0
        public override void Write(TextWriter writer, Context context)
        {
            var value = context.GetValue(_expression);

            if (value.IsNullOrNoValue())
            {
                return;
            }

            try
            {
                context.Push(value, null);
                _content.Write(writer, context);
            }
            catch (Exception)
            {
                context.Pop();
            }
        }
Example #7
0
 public override void Write(TextWriter writer, Context context)
 {
     var value = context.GetValue(_expression);
     if (value.IsNullOrNoValue()) return;
     writer.Write(Convert.ToString(value));
 }