Beispiel #1
0
 private void ResetItemsByNodeData(UTreeNodeData data, UTreeBranch branch)
 {
     if (data.Children != null)
     {
         foreach (UTreeNodeData child in data.Children)
         {
             if (child.IsBranch)
             {
                 UTreeBranch grandBranch = GetOneBranch();
                 grandBranch.Data = child;
                 branch.SetChild(grandBranch.tran);
                 foreach (UTreeNodeData grandChild in child.Children)
                 {
                     ResetItemsByNodeData(grandChild, grandBranch);
                 }
             }
             else
             {
                 UTreeLeaf leaf = GetOneLeaf();
                 //leaf.Data = data;
                 leaf.Data = child;
                 branch.SetChild(leaf.tran);
             }
         }
     }
     else
     {
         UTreeLeaf leaf = GetOneLeaf();
         //leaf.Data = data;
         leaf.Data = data;
         branch.SetChild(leaf.tran);
     }
 }
Beispiel #2
0
        private void SetBranchData(UTreeNodeData data, UTreeBranch pBranch)
        {
            UTreeBranch branch = GetOneBranch();

            branch.Data = data;
            if (pBranch != null)
            {
                pBranch.SetChild(branch.tran);
            }
            else
            {
                branch.SetParent(content);
            }
            foreach (UTreeNodeData childData in data.Children)
            {
                if (childData.IsBranch)
                {
                    SetBranchData(childData, branch);
                }
                else
                {
                    SetLeafData(childData, branch);
                }
            }
        }
Beispiel #3
0
        private void SetLeafData(UTreeNodeData data, UTreeBranch branch)
        {
            UTreeLeaf leaf = GetOneLeaf();

            leaf.Data = data;
            if (branch != null)
            {
                branch.SetChild(leaf.tran);
            }
            else
            {
                leaf.SetParent(content);
            }
        }