public TreeNodeShortcut CreateShortcut() { TreeNodeShortcut tns = new TreeNodeShortcut(this.TreeNodeId); VPLUtil.CopyProperties(this, tns); tns.SetValueList(_data); tns.SetReferenceNode(this); tns.DataXmlNode = DataXmlNode; return(tns); }
public override TreeNodeX CreateDuplicatedNode(TreeViewX targetHolder) { XmlDocument docTarget = targetHolder.GetXmlDocument(); if (docTarget != _pointerXmlNode.OwnerDocument) { throw new TreeViewXException("Cannot duplicate shortcut bewteen different tree views"); } ObjectXmlReader oxr = new ObjectXmlReader(); XmlNode pointerXml = _pointerXmlNode.Clone(); TreeNodeShortcut tns = new TreeNodeShortcut(pointerXml, oxr); return(tns); }
private void treeView1_AfterSelect(object sender, TreeViewEventArgs e) { TreeNodeShortcut tns = e.Node as TreeNodeShortcut; if (tns != null) { propertyGrid1.SelectedObject = tns; // buttonAddValue.Enabled = false; buttonDelNode.Enabled = true; buttonDelVal.Enabled = false; buttonSubNode.Enabled = false; } else { TreeNodeX tnx = e.Node as TreeNodeX; if (tnx != null) { propertyGrid1.SelectedObject = tnx; // buttonAddValue.Enabled = !tnx.IsShortcut; buttonDelNode.Enabled = !tnx.IsShortcut; buttonDelVal.Enabled = false; buttonSubNode.Enabled = !tnx.IsShortcut; } else { TreeNodeValue tnv = e.Node as TreeNodeValue; if (tnv != null) { propertyGrid1.SelectedObject = tnv.Data; // buttonAddValue.Enabled = false; buttonDelNode.Enabled = false; buttonDelVal.Enabled = true; buttonSubNode.Enabled = false; } } } }
public void RemoveAllShortcuts(Guid id) { if (NextLevelLoaded) { List <TreeNodeShortcut> l = new List <TreeNodeShortcut>(); for (int i = 0; i < Nodes.Count; i++) { TreeNodeShortcut ts = Nodes[i] as TreeNodeShortcut; if (ts != null && ts.TreeNodeId == id) { l.Add(ts); } TreeNodeX tnx = Nodes[i] as TreeNodeX; if (tnx != null) { tnx.RemoveAllShortcuts(id); } } foreach (TreeNodeShortcut ts in l) { ts.Remove(); } } }
public TreeNodeShortcutEventArgs(TreeNodeShortcut node, TreeViewAction action) { _node = node; _act = action; }
public TreeNodeShortcutMouseClickEventArgs(TreeNodeShortcut node, TreeNodeMouseClickEventArgs e) : base(node, e.Button, e.Clicks, e.X, e.Y) { _node = node; }
public TreeNodeShortcutMouseClickEventArgs(TreeNodeShortcut node, MouseButtons buttons, int clicks, int x, int y) : base(node, buttons, clicks, x, y) { _node = node; }