Skip to content

Commit 8313189

Browse files
committed
Fix navigating to recycle bin from navbar
1 parent a8f1770 commit 8313189

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Files.FullTrust/Helpers/ShellFolderHelpers.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ public static ShellFileItem GetShellFileItem(ShellItem folderItem)
4444
parsingPath ??= folderItem.FileSystemPath; // True path on disk
4545
if (parsingPath == null || !Path.IsPathRooted(parsingPath))
4646
{
47-
// Use PIDL as path
48-
parsingPath = $@"\\SHELL\{string.Join("\\", folderItem.PIDL.Select(x => x.GetBytes()).Select(x => Convert.ToBase64String(x, 0, x.Length)))}";
47+
parsingPath = parsingPath switch
48+
{
49+
"::{645FF040-5081-101B-9F08-00AA002F954E}" => "Shell:RecycleBinFolder",
50+
"::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}" => "Shell:NetworkPlacesFolder",
51+
"::{208D2C60-3AEA-1069-A2D7-08002B30309D}" => "Shell:NetworkPlacesFolder",
52+
// Use PIDL as path
53+
_ => $@"\\SHELL\{string.Join("\\", folderItem.PIDL.Select(x => x.GetBytes()).Select(x => Convert.ToBase64String(x, 0, x.Length)))}"
54+
};
4955
}
5056
folderItem.Properties.TryGetValue<string>(
5157
Ole32.PROPERTYKEY.System.ItemNameDisplay, out var fileName);

0 commit comments

Comments
 (0)