public override bool Visit <T, TProperty>(NotNullNode <T, TProperty> node, Func <RuntimeVisitor, bool> next)
        {
            _current = _vertices.Get(node.Id,
                                     id => new Vertex(typeof(NotNullNode <,>), typeof(Token <T, TProperty>), "not null"));

            if (_stack.Count > 0)
            {
                _edges.Add(new Edge(_stack.Peek(), _current, _current.TargetType.Name));
            }

            return(Next(() => base.Visit(node, next)));
        }
Esempio n. 2
0
        public override bool Visit <TT, TTProperty>(NotNullNode <TT, TTProperty> node,
                                                    Func <RuntimeModelVisitor, bool> next)
        {
            var locator = this as NotNullNodeSelector <TT, TTProperty>;

            if (locator != null)
            {
                locator._node = node;
                return(false);
            }

            return(base.Visit(node, next));
        }
Esempio n. 3
0
        public void Select <TNode>(Node <TNode> node)
            where TNode : class
        {
            _node = null;
            node.Accept(this);

            if (_node == null)
            {
                NotNullNode <T, TProperty> compareNode = _configurator.NotNull <T, TProperty>();

                var parentNode = node as Node <Token <T, TProperty> >;
                if (parentNode == null)
                {
                    throw new ArgumentException("Expected " + typeof(T).Tokens() + ", but was "
                                                + typeof(TNode).Tokens());
                }

                parentNode.AddActivation(compareNode);

                _node = compareNode;
            }

            _next.Select(_node);
        }
        public override bool Visit <T, TProperty>(NotNullNode <T, TProperty> node, Func <RuntimeVisitor, bool> next)
        {
            Append("NotNullNode[{0}] != null", Tokens <T>());

            return(Indent(next));
        }
 public virtual bool Visit <T, TProperty>(NotNullNode <T, TProperty> node, Func <RuntimeVisitor, bool> next)
     where T : class
     where TProperty : class
 {
     return(next(this));
 }