示例#1
0
文件: Tree.cs 项目: mictxd/helpTXD
    /** 返回当前节点的父辈节点集合 形成路径使用 */

    public List <MultTreeNode> getElders()
    {
        ListExtA <MultTreeNode> elderList  = new ListExtA <MultTreeNode>();
        MultTreeNode            parentNode = this.getParentNode();

        if (parentNode == null)
        {
            return(elderList);
        }
        else
        {
            elderList.AddAll(parentNode.getElders());
            elderList.Add(parentNode);
            return(elderList);
        }
    }
示例#2
0
文件: Tree.cs 项目: mictxd/helpTXD
    /** 返回当前节点的晚辈集合 */

    public List <MultTreeNode> getJuniors()
    {
        ListExtA <MultTreeNode> juniorList = new ListExtA <MultTreeNode>();
        List <MultTreeNode>     childList  = this.getChildList();

        if (childList == null)
        {
            return(juniorList);
        }
        else
        {
            int childNumber = childList.Count;
            for (int i = 0; i < childNumber; i++)
            {
                MultTreeNode junior = childList.ElementAt(i);
                juniorList.Add(junior);
                juniorList.AddAll(junior.getJuniors());
            }
            return(juniorList);
        }
    }