diff --git a/src/client/spark_core/Collections/SortedTree.cs b/src/client/spark_core/Collections/SortedTree.cs index 00f7e1ef1..72622e344 100644 --- a/src/client/spark_core/Collections/SortedTree.cs +++ b/src/client/spark_core/Collections/SortedTree.cs @@ -305,6 +305,13 @@ namespace bts.collections { Node GetRootNode(Node node) => _index.TryGetValue(parent(node.value), out Node pnode) ? GetRootNode(pnode) : node; + public INode GetParent(T item) { + if (_index.TryGetValue(parent(item), out Node pnode)) { + return pnode; + } + return null; + } + public IEnumerable EnumerateGroup(T item) { var pnode = parentmost(item); return pnode == null ? Enumerable.Empty() : EnumerateNode(pnode);