Exemplo n.º 1
0
        private TreeEvalItem <TTreeNode> GetLastLeaf(TTreeNode node, int currentDepth, TreeNodePath path)
        {
            IList <TTreeNode> children = m_traversalParameters.GetChildrenMethod(node).ToList();

            if (children.Count == 0)
            {
                return(new TreeEvalItem <TTreeNode>(node, path));
            }

            int lastIndex = children.Count - 1;

            path.AddToPath(lastIndex);
            return(GetLastLeaf(children[lastIndex], currentDepth + 1, path));
        }