public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
 {
     if (context != null && context.Instance != null && provider != null)
     {
         IWindowsFormsEditorService edSvc = (IWindowsFormsEditorService)provider.GetService(typeof(IWindowsFormsEditorService));
         if (edSvc != null)
         {
             HtmlTreeView tr = context.Instance as HtmlTreeView;
             if (tr != null)
             {
                 DlgHtmlTreeViewEditor dlg = new DlgHtmlTreeViewEditor();
                 dlg.LoadData(tr);
                 if (edSvc.ShowDialog(dlg) == System.Windows.Forms.DialogResult.OK)
                 {
                     dlg.SaveData(tr);
                     IDevClass dc = tr.GetDevClass();
                     if (dc != null)
                     {
                         dc.NotifyChange(tr, context.PropertyDescriptor.Name);
                     }
                 }
             }
         }
     }
     return(value);
 }
Пример #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
 public void SaveData(HtmlTreeView treeView)
 {
     treeView.Nodes.Clear();
     if (treeView.ImageList == null)
     {
         IWebPage wp = treeView.FindForm() as IWebPage;
         if (wp != null)
         {
             treeView.ImageList = wp.AddComponent(typeof(ImageList)) as ImageList;
         }
     }
     copyNodes(treeView1.Nodes, treeView.Nodes, treeView.ImageList);
 }
Пример #4
0
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            PropertyDescriptorCollection ps  = TypeDescriptor.GetProperties(this, attributes, true);
            List <PropertyDescriptor>    lst = new List <PropertyDescriptor>();

            foreach (PropertyDescriptor p in ps)
            {
                if (_propertyNames.Contains(p.Name))
                {
                    lst.Add(p);
                }
            }
            HtmlTreeView htv = this.TreeView as HtmlTreeView;

            if (htv != null)
            {
                lst.Add(new PropertyDescriptorHtmlTreeNodeCollection(this, htv));
            }
            WebClientValueCollection.AddPropertyDescs(lst, this.CustomValues);
            return(new PropertyDescriptorCollection(lst.ToArray()));
        }
 public HtmlTreeNodeCollection(HtmlTreeView tree, HtmlTreeNode parent)
 {
     _tree       = tree;
     _parentNode = parent;
 }
Пример #6
0
 public void LoadData(HtmlTreeView treeView)
 {
     copyNodes(treeView.Nodes, treeView1.Nodes, imageList1);
 }