示例#1
0
        public void Select <TNode>(Node <TNode> node) where TNode : class
        {
            _node = null;
            node.Accept(this);

            if (_node == null)
            {
                AlphaNode <T> alphaNode = _configurator.Alpha <T>();

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

                parentNode.AddActivation(alphaNode);

                _node = alphaNode;
            }

            _next.Select(_node);
        }