private IEnumerable <string> GetRoots(string pattern) { if (string.IsNullOrEmpty(pattern)) { return(Enumerable.Empty <string>()); } if (!_searchTree.IsPathRooted(pattern)) { return(_searchTree.GetTreeRoots()); } var root = _searchTree.GetPathRoot(pattern); var p = pattern.Substring(root.Length); var path = GetLongestPath(p, root); return(new[] { path }); }