/// <summary> /// Raises the AfterSelNodesRemove Event. /// </summary> /// <param name="e">Standard EventArgs object.</param> public void OnAfterSelNodesRemove(MWControlSuite.MWPropertyEventArgs e) { if(AfterSelNodesRemove != null) { AfterSelNodesRemove(this, e); } }
/// <summary> /// Raises the AfterTreeNodeMouseDownChanged Event. /// </summary> /// <param name="e">Standard EventArgs object.</param> public void OnAfterTreeNodeMouseDownChanged(MWControlSuite.MWPropertyEventArgs e) { if(AfterTreeNodeMouseDownChanged != null) { AfterTreeNodeMouseDownChanged(this, e); } }
/// <summary> /// Raises the AfterCheckedNodesAdd Event. /// </summary> /// <param name="e">Standard EventArgs object.</param> public void OnAfterCheckedNodesAdd(MWControlSuite.MWPropertyEventArgs e) { if(AfterCheckedNodesAdd != null) { AfterCheckedNodesAdd(this, e); } }
/// <summary> /// Raises the AfterSelNodeChanged Event. /// </summary> /// <param name="e">Standard EventArgs object.</param> public void OnAfterSelNodeChanged(MWControlSuite.MWPropertyEventArgs e) { if(AfterSelNodeChanged != null) { AfterSelNodeChanged(this, e); } }
/// <summary> /// Standard ValueChanged EventHandler for the EditorHatchStyleUI ehsui. /// </summary> /// <param name="sender">Standard sender object.</param> /// <param name="e">Standard MWHatchStyleEventArgs object.</param> private void ValueChanged(object sender, MWControlSuite.MWHatchStyleEventArgs e) { if(pd != null && oInstance != null) { //This does not work, i.e. it does not update the property in Visual Studio. //Create a PBPercentEventArgs etc and it will work; look at EditorShadowDirection (names have to match I think // so name the property PBPercent in the PBPercentEventArgs class). pd.SetValue(oInstance, e.NewHatchStyle); } }
const int excludeFindTreeNodeLevel = 3; // 查找不会找这个level的树结点 public FindForm(MWControlSuite.MWTreeView tree) { InitializeComponent(); m_tree = tree; }
NGTreeNode[] SelectedNodes(MWControlSuite.MWTreeView tree) { Hashtable hash = tree.SelNodes; NGTreeNode[] result = new NGTreeNode[hash.Count]; int i=0; foreach (DictionaryEntry dict in hash) result[i++] = ((MWControlSuite.MWTreeNodeWrapper)dict.Value).Node.Tag as NGTreeNode; NGTreeNode.SortByOrder(result); return result; }
Hashtable SelectedNGNodes(MWControlSuite.MWTreeView view) { Hashtable result = new Hashtable(); Hashtable selected = view.SelNodes; foreach (DictionaryEntry en in selected) { result.Add(((MWControlSuite.MWTreeNodeWrapper)en.Value).Node.Tag, null); } return result; }
void Update(MWControlSuite.MWTreeView view, TreeNodeCollection tree, NGTreeNodeCollection coll, Hashtable selectedNGNodes) { if (tree.Count != 0) throw new ApplicationException("Tree must be empty here"); for (int i = 0; i < coll.Count; i++) { bool isExpanded = false; if (null != coll[i].GuiTag) { TreeNode node = (TreeNode)coll[i].GuiTag; isExpanded = node.IsExpanded; node.Remove(); node.Nodes.Clear(); tree.Add(node); } else { tree.Add(NewNode(coll[i])); } if (coll[i].Nodes.Count > 0) Update(view,tree[i].Nodes, coll[i].Nodes,selectedNGNodes); if (isExpanded) tree[i].Expand(); if (null != selectedNGNodes && selectedNGNodes.ContainsKey(coll[i])) { view.SelectNode(tree[i], false); if (tree[i].Parent != null && !(tree[i].Parent.IsExpanded)) tree[i].Parent.Expand(); } } }