Esempio n. 1
0
        /// <summary>
        /// Custom node finder
        /// </summary>
        /// <param name="_Node"></param>
        /// <param name="_D"></param>
        /// <returns></returns>
        public Node             FindNode(Node _Node, FindNodeDelegate _D)
        {
            if (_D(_Node))
            {
                return(_Node);                  // Found it !
            }
            foreach (Node Child in _Node.Children)
            {
                Node Result = FindNode(Child, _D);
                if (Result != null)
                {
                    return(Result);
                }
            }

            return(null);
        }
Esempio n. 2
0
        /// <summary>
        /// Custom node finder
        /// </summary>
        /// <param name="_Node"></param>
        /// <param name="_D"></param>
        /// <returns></returns>
        public Node FindNode( Node _Node,  FindNodeDelegate _D )
        {
            if ( _D( _Node ) )
                return _Node;	// Found it !

            foreach ( Node Child in _Node.Children )
            {
                Node	Result = FindNode( Child, _D );
                if ( Result != null )
                    return Result;
            }

            return null;
        }