Ejemplo n.º 1
0
        private Node AddChild(Node parent, string nodename)
        {
            Node node = new PlistNode(nodename);

            parent.Nodes.Add(node);
            return(node);
        }
Ejemplo n.º 2
0
        private Node AddRoot(string nodename)
        {
            Node node = new PlistNode(nodename);

            _model.Nodes.Add(node);
            return(node);
        }
Ejemplo n.º 3
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);
        }
Ejemplo n.º 4
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;
        }
Ejemplo n.º 5
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);
                    }
                }
            }
        }
Ejemplo n.º 6
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);
             }
         }
     }
 }