public int GetDepth(MyTreeNodeElem e) { int jumps = 0; var node = e; while (node.ParentID != null) { node = Nodes.Where(r => r.ID == node.ParentID).FirstOrDefault(); jumps++; } return(jumps); }
public Point CenterOfNode(MyTreeNodeElem e) { return(new Point(e.Location.X + LEFT_OFFSET, e.Location.Y + e.Height / 2)); }
public void AddNode(MyTreeNodeElem node) { Nodes.Add(node); }