private bool EditMenuItemsChangeCallback(object context) { bool changed = false; DeluxeTree oControl = (DeluxeTree)Component; IServiceProvider site = oControl.Site; IComponentChangeService changeService = null; try { DeluxeTreeItemsEditorForm oEditorForm = new DeluxeTreeItemsEditorForm(oControl); if (site != null) { IUIService service = (IUIService)site.GetService(typeof(IUIService)); if (service != null) { if (service.ShowDialog(oEditorForm) == DialogResult.OK) { changed = true; } } } } finally { if (changed && changeService != null) { changeService.OnComponentChanged(oControl, null, null, null); } } return(changed); }
private MCS.Web.Responsive.WebControls.DeluxeTree CreateDynamicTree() { MCS.Web.Responsive.WebControls.DeluxeTree tree = new MCS.Web.Responsive.WebControls.DeluxeTree(); tree.Width = Unit.Pixel(200); tree.Height = Unit.Pixel(300); tree.BorderStyle = BorderStyle.Solid; tree.BorderWidth = Unit.Pixel(1); tree.NodeCloseImg = "closeImg.gif"; tree.NodeOpenImg = "openImg.gif"; tree.Style["overflow"] = "auto"; tree.Style["padding-left"] = "5px"; //tree.GetChildrenData += new WebControls.DeluxeTree.GetChildrenDataDelegete(tree_GetChildrenData); DeluxeTreeNode first = new DeluxeTreeNode("First Node", "FirstNode"); first.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading; tree.Nodes.Add(first); DeluxeTreeNode second = new DeluxeTreeNode("Second Node", "SecondNode"); second.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading; tree.Nodes.Add(second); return(tree); }
public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value) { IDesignerHost service = (IDesignerHost)context.GetService(typeof(IDesignerHost)); DeluxeTree component = (DeluxeTree)context.Instance; ((DeluxeTreeItemsDesigner)service.GetDesigner(component)).InvokeMenuItemCollectionEditor(); return(value); }
private void InnerTree_TargetControlLoaded(Control targetControl) { if ((targetControl is DeluxeTree) && targetControl.ID.IndexOf("oguInnerTree") >= 0) { DeluxeTree tree = (DeluxeTree)targetControl; tree.GetChildrenData += new DeluxeTree.GetChildrenDataDelegate(tree_GetChildrenData); } }
private void Instance_TargetControlLoaded(Control targetControl) { MCS.Web.Responsive.WebControls.DeluxeTree tree = targetControl as MCS.Web.Responsive.WebControls.DeluxeTree; if (tree != null) { tree.GetChildrenData += new MCS.Web.Responsive.WebControls.DeluxeTree.GetChildrenDataDelegate(tree_GetChildrenData); } }
protected override void CreateChildControls() { this.Style["overflow"] = "auto"; this.tree = new DeluxeTree(); this.tree.ID = "oguInnerTree"; this.tree.GetChildrenData += new DeluxeTree.GetChildrenDataDelegate(tree_GetChildrenData); this.tree.Width = Unit.Percentage(100); this.tree.Height = Unit.Percentage(100); this.tree.ShowLines = false; Controls.Add(this.tree); base.CreateChildControls(); }
public DeluxeTreeItemsEditorForm(DeluxeTree oMenu) { InitializeComponent(); this._firstActivate = true; _navBar = oMenu; Items = oMenu.Nodes; _serviceProvider = oMenu.Site; // add pre-existing nodes foreach (MCS.Web.Responsive.WebControls.DeluxeTreeNode oRoot in Items) { TreeNode oRootNode = new TreeNode(oRoot.Text); LoadNodes(oRoot, oRootNode); _treeView.Nodes.Add(oRootNode); } this.propertyGrid1.Site = new FormPropertyGridSite(_serviceProvider, this.propertyGrid1); _treeView.HideSelection = false; }
private MCS.Web.Responsive.WebControls.DeluxeTree CreateDynamicTree() { MCS.Web.Responsive.WebControls.DeluxeTree tree = new MCS.Web.Responsive.WebControls.DeluxeTree(); tree.Width = Unit.Pixel(200); tree.Height = Unit.Pixel(300); tree.BorderStyle = BorderStyle.Solid; tree.BorderWidth = Unit.Pixel(1); tree.NodeCloseImg = "closeImg.gif"; tree.NodeOpenImg = "openImg.gif"; tree.Style["overflow"] = "auto"; tree.Style["padding-left"] = "5px"; //tree.GetChildrenData += new WebControls.DeluxeTree.GetChildrenDataDelegete(tree_GetChildrenData); DeluxeTreeNode first = new DeluxeTreeNode("First Node", "FirstNode"); first.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading; tree.Nodes.Add(first); DeluxeTreeNode second = new DeluxeTreeNode("Second Node", "SecondNode"); second.ChildNodesLoadingType = ChildNodesLoadingTypeDefine.LazyLoading; tree.Nodes.Add(second); return tree; }
public override bool EditComponent(ITypeDescriptorContext context, object component, IWin32Window owner) { DeluxeTree oControl = (DeluxeTree)component; IServiceProvider site = oControl.Site; IComponentChangeService changeService = null; DesignerTransaction transaction = null; bool changed = false; try { if (site != null) { IDesignerHost designerHost = (IDesignerHost)site.GetService(typeof(IDesignerHost)); transaction = designerHost.CreateTransaction("BuildMenu"); changeService = (IComponentChangeService)site.GetService(typeof(IComponentChangeService)); if (changeService != null) { try { changeService.OnComponentChanging(component, null); } catch (CheckoutException ex) { if (ex == CheckoutException.Canceled) { return(false); } throw ex; } } } try { DeluxeTreeItemsEditorForm oEditorForm = new DeluxeTreeItemsEditorForm(oControl); if (oEditorForm.ShowDialog(owner) == DialogResult.OK) { changed = true; } } finally { if (changed && changeService != null) { changeService.OnComponentChanged(oControl, null, null, null); } } } finally { if (transaction != null) { if (changed) { transaction.Commit(); } else { transaction.Cancel(); } } } return(changed); }