public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            List <PropertyDescriptor> lst = new List <PropertyDescriptor>();
            TreeNodeCollection        nodes;

            if (_parentNode == null)
            {
                nodes = _tree.Nodes;
            }
            else
            {
                nodes = _parentNode.Nodes;
            }
            int i = 1;

            foreach (TreeNode tn in nodes)
            {
                HtmlTreeNode htn = tn as HtmlTreeNode;
                if (htn != null)
                {
                    PropertyDescriptorHtmlTreeNode p = new PropertyDescriptorHtmlTreeNode(htn, i);
                    lst.Add(p);
                    i++;
                }
            }
            //
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }
예제 #2
0
 public PropertyDescriptorHtmlTreeNodeCollection(HtmlTreeNode node, HtmlTreeView tree)
     : base(string.Format(CultureInfo.InvariantCulture, "ChildNodes - Level {0}", node.Level + 1), new Attribute[] { new WebClientMemberAttribute() })
 {
     _tree   = tree;
     _node   = node;
     _childs = new HtmlTreeNodeCollection(_tree, _node);
 }
예제 #3
0
        private void propertyGrid1_PropertyValueChanged(object s, PropertyValueChangedEventArgs e)
        {
            HtmlTreeNode tnx = propertyGrid1.SelectedObject as HtmlTreeNode;

            if (tnx != null)
            {
            }
        }
예제 #4
0
        private void treeView1_AfterSelect(object sender, TreeViewEventArgs e)
        {
            HtmlTreeNode tnx = e.Node as HtmlTreeNode;

            propertyGrid1.SelectedObject = tnx;
            buttonDelNode.Enabled        = (tnx != null);
            buttonSubNode.Enabled        = (tnx != null);
        }
예제 #5
0
        private void buttonRootNode_Click(object sender, EventArgs e)
        {
            HtmlTreeNode tn = new HtmlTreeNode();

            tn.Text               = "New root node";
            tn.ImageIndex         = -1;
            tn.SelectedImageIndex = -1;
            treeView1.Nodes.Add(tn);
        }
예제 #6
0
        private void buttonSubNode_Click(object sender, EventArgs e)
        {
            TreeNode sn = treeView1.SelectedNode;

            if (sn != null)
            {
                HtmlTreeNode tn = new HtmlTreeNode();
                tn.Text               = "New sub node";
                tn.ImageIndex         = -1;
                tn.SelectedImageIndex = -1;
                sn.Nodes.Add(tn);
            }
        }
예제 #7
0
 private void copyNodes(TreeNodeCollection nodesSrc, TreeNodeCollection nodesTgt, ImageList imageList)
 {
     foreach (TreeNode sn in nodesSrc)
     {
         HtmlTreeNode sn0 = sn as HtmlTreeNode;
         if (sn0 != null)
         {
             HtmlTreeNode tn = sn0.CloneHtmlTreeNode();
             nodesTgt.Add(tn);
             tn.ImageIndex         = VPLUtil.GetImageIndex(tn.IconImagePath, imageList);
             tn.SelectedImageIndex = tn.ImageIndex;
             copyNodes(sn0.Nodes, tn.Nodes, imageList);
         }
     }
 }
예제 #8
0
        public HtmlTreeNode CloneHtmlTreeNode()
        {
            HtmlTreeNode tn = new HtmlTreeNode();

            tn.Text           = this.Text;
            tn.Name           = this.Name;
            tn.nodeName       = this.nodeName;
            tn.IconImagePath  = this.IconImagePath;
            tn.NodeTitleHtml  = this.NodeTitleHtml;
            tn.noteFontFamily = this.noteFontFamily;
            tn.noteFontSize   = this.noteFontSize;
            tn.noteFontColor  = this.noteFontColor;
            tn.nodedata       = this.nodedata;
            tn.noteBackColor  = this.noteBackColor;
            return(tn);
        }
 public HtmlTreeNodeCollection(HtmlTreeView tree, HtmlTreeNode parent)
 {
     _tree       = tree;
     _parentNode = parent;
 }
 public PropertyDescriptorHtmlTreeNode(HtmlTreeNode node, int idx)
     : base(string.Format(CultureInfo.InvariantCulture, "Node {0} - {1}", idx, node.ToString()), new Attribute[] { })
 {
     _node = node;
 }