private Node GetPreviousChild(Node child, SortedNodeList <Node> children) { int index = (child != null) ? children.IndexOf(child) : -1; if (index > 0) { return(children[index - 1]); } return(null); }
private Node GetNextChild(Node child, SortedNodeList <Node> children) { int index = (child != null) ? children.IndexOf(child) : -1; if (index != -1 && index + 1 < children.Count) { return(children[index + 1]); } return(null); }