public IEnumerable <Folder> GetPhysicalParents() { var rootChildren = LibraryManager.RootFolder.Children .OfType <Folder>() .ToList(); return(PhysicalLocations.Where(i => !string.Equals(i, Path, StringComparison.OrdinalIgnoreCase)).SelectMany(i => GetPhysicalParents(i, rootChildren)).DistinctBy(i => i.Id)); }
private IEnumerable <Folder> GetPhysicalFolders(bool enableCache) { if (enableCache) { return(PhysicalFolderIds.Select(i => LibraryManager.GetItemById(i)).OfType <Folder>()); } var rootChildren = LibraryManager.RootFolder.Children .OfType <Folder>() .ToList(); return(PhysicalLocations.Where(i => !string.Equals(i, Path, StringComparison.OrdinalIgnoreCase)).SelectMany(i => GetPhysicalParents(i, rootChildren)).DistinctBy(i => i.Id)); }
private IEnumerable <Folder> GetPhysicalFolders(bool enableCache) { if (enableCache) { return(PhysicalFolderIds.Select(i => LibraryManager.GetItemById(i)).OfType <Folder>()); } var rootChildren = LibraryManager.RootFolder.Children .OfType <Folder>() .ToList(); return(PhysicalLocations.Where(i => !FileSystem.AreEqual(i, Path)).SelectMany(i => GetPhysicalParents(i, rootChildren)).DistinctBy(i => i.Id)); }