コード例 #1
0
        public override void AfterVisit(AttributeNode attributeNode)
        {
            if (_propertyValueEmitter == null)
                _propertyValueEmitter = EmitterNode.Lambda<VPropertyValue>((d, r) => null);

            var valueEmitter = _propertyValueEmitter;
            _properties.Peek().Add(EmitterNode.AsList(EmitterNode.Lambda((d, r) => new VProperty(attributeNode.Name, valueEmitter.Execute(d, r)))));

            _propertyValueEmitter = null;
        }
コード例 #2
0
        public static void AssertAttribute(AttributeNode expected, AttributeNode actual)
        {
            Assert.Equal(expected.Name, actual.Name);
            if (expected.Value == null)
                Assert.Null(actual.Value);

            AssertAttributeContent(expected.Value, actual.Value);
        }
コード例 #3
0
 public virtual void AfterVisit(AttributeNode attributeNode)
 {
 }
コード例 #4
0
 public virtual bool BeforeVisit(AttributeNode attributeNode)
 {
     return false;
 }
コード例 #5
0
 public override bool BeforeVisit(AttributeNode attributeNode)
 {
     return true;
 }
コード例 #6
0
		public void AfterVisit(AttributeNode attributeNode)
		{
			var scope = _scopes.Pop();
			Action<TextWriter, IDataContext, IRenderingContext> a = (w, d, rc) =>
			{
				foreach (var element in scope.Elements)
				{
					element(w, d, rc);
				}
			};

			var parentScope = _scopes.Peek();
			parentScope.Attributes.Add(new Tuple<Action<TextWriter, IDataContext, IRenderingContext>, Action<TextWriter, IDataContext, IRenderingContext>>((w, d, r) => w.Write(attributeNode.Name), a));
		}
コード例 #7
0
		public bool BeforeVisit(AttributeNode attributeNode)
		{
			_scopes.Push(new Scope());
			return true;
		}