protected virtual string PathTo(TreeNode givenNode) { StringBuilder nodePath = new StringBuilder(); List<TreeNode> selectedNodePath = tree.GetPathTo(givenNode); foreach (TreeNode currentNode in selectedNodePath) { nodePath.AppendFormat("\"{0}\"", currentNode.Name); if (!selectedNodePath[selectedNodePath.Count - 1].Equals(currentNode)) nodePath.Append(","); } return nodePath.ToString(); }
/// <summary> /// Finds path to the TreeNode. It doesn't expand the nodes to find it. /// </summary> /// <param name="node"></param> /// <returns></returns> public virtual List<TreeNode> GetPathTo(TreeNode node) { return Nodes.GetPathTo(node); }
public TreeNodeClickedEvent(Tree tree, TreeNode node, bool isExpanded) : base(tree) { clickedNode = node; this.isExpanded = isExpanded; }
public TreeNodeSelectEvent(Tree tree, TreeNode node) : base(tree) { selectedNode = node; }
public virtual void Accept(TreeNode treeNode) { if (treeNode.Bounds.Top <= Mouse.instance.Location.Y && treeNode.Bounds.Bottom >= Mouse.instance.Location.Y) clickedNode = treeNode; }