Exemple #1
0
        public bool PasteClip(TreeModel model, System.Windows.Forms.ImageList imagelist)
        {
            if (string.IsNullOrEmpty(tree.rootkey))
            {
                return(false);
            }
            PlistNodeData data       = tree.GetDataByUniqueKey(tree.rootkey);
            Node          parentNode = new PlistNode(data.key);

            model.Nodes.Add(parentNode);
            parentNode.Image = imagelist.Images[data.nodeType.ToString()];
            parentNode.Tag   = data.DeepCopy();
            foreach (string key in tree.nodeRelationship.Keys)
            {
                if (key == tree.rootkey)
                {
                    List <string> childrenkey = tree.nodeRelationship[key];
                    foreach (string childkey in childrenkey)
                    {
                        DrawChildNode(parentNode, tree.GetDataByUniqueKey(childkey), imagelist);
                    }
                }
            }

            return(true);
        }
Exemple #2
0
        private void DrawChildNode(Node parentNode, PlistNodeData data, System.Windows.Forms.ImageList imagelist)
        {
            Node nodeAdded = new PlistNode(data.key);

            parentNode.Nodes.Add(nodeAdded);
            nodeAdded.Tag   = data.DeepCopy();
            nodeAdded.Image = imagelist.Images[data.nodeType.ToString()];
            if (!tree.nodeRelationship.ContainsKey(data.uniquekey))
            {
                return;
            }
            foreach (string key in tree.nodeRelationship.Keys)
            {
                if (key == data.uniquekey)
                {
                    List <string> childrenkey = tree.nodeRelationship[key];
                    foreach (string childkey in childrenkey)
                    {
                        DrawChildNode(nodeAdded, tree.GetDataByUniqueKey(childkey), imagelist);
                    }
                }
            }
        }
 private void DrawChildNode(Node parentNode, PlistNodeData data, System.Windows.Forms.ImageList imagelist)
 {
     Node nodeAdded = new PlistNode(data.key);
     parentNode.Nodes.Add(nodeAdded);
     nodeAdded.Tag = data.DeepCopy();
     nodeAdded.Image = imagelist.Images[data.nodeType.ToString()];
     if(!tree.nodeRelationship.ContainsKey(data.uniquekey))
     {
         return;
     }
     foreach(string key in tree.nodeRelationship.Keys)
     {
         if(key == data.uniquekey)
         {
             List<string> childrenkey = tree.nodeRelationship[key];
             foreach(string childkey in childrenkey)
             {
                 DrawChildNode(nodeAdded, tree.GetDataByUniqueKey(childkey), imagelist);
             }
         }
     }
 }