Пример #1
0
 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();
 }
Пример #2
0
 /// <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);
 }
Пример #3
0
 public TreeNodeClickedEvent(Tree tree, TreeNode node, bool isExpanded)
     : base(tree)
 {
     clickedNode = node;
     this.isExpanded = isExpanded;
 }
Пример #4
0
 public TreeNodeSelectEvent(Tree tree, TreeNode node)
     : base(tree)
 {
     selectedNode = node;
 }
Пример #5
0
 public virtual void Accept(TreeNode treeNode)
 {
     if (treeNode.Bounds.Top <= Mouse.instance.Location.Y && treeNode.Bounds.Bottom >= Mouse.instance.Location.Y)
         clickedNode = treeNode;
 }