Ejemplo n.º 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);
     }
 }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
0
 private void ResetTreeItem()
 {
     branchUsingIndex = 0;
     leafUsingIndex   = 0;
     foreach (UTreeNodeData data in nodeData)
     {
         if (data.IsBranch)
         {
             UTreeBranch branch = GetOneBranch();
             branch.Data = data;
             branch.SetParent(content);
             ResetItemsByNodeData(data, branch);
         }
         else
         {
             UTreeLeaf leaf = GetOneLeaf();
             leaf.Data = data;
             leaf.SetParent(content);
         }
     }
 }