Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Files.App/Shell/ContextMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public async Task<bool> InvokeVerb(string? verb)

return true;
}
catch (Exception ex) when (ex is COMException || ex is UnauthorizedAccessException)
catch (Exception ex) when (ex is COMException or UnauthorizedAccessException)
{
Debug.WriteLine(ex);
}
Expand Down Expand Up @@ -90,7 +90,7 @@ public async Task InvokeItem(int itemID)

Win32API.BringToForeground(currentWindows);
}
catch (Exception ex) when (ex is COMException || ex is UnauthorizedAccessException)
catch (Exception ex) when (ex is COMException or UnauthorizedAccessException)
{
Debug.WriteLine(ex);
}
Expand All @@ -110,7 +110,7 @@ public async Task InvokeItem(int itemID)
shellItems.Add(ShellFolderExtensions.GetShellItemFromPathOrPidl(fp));
return GetContextMenuForFiles(shellItems.ToArray(), flags, owningThread, itemFilter);
}
catch (Exception ex) when (ex is ArgumentException || ex is FileNotFoundException)
catch (Exception ex) when (ex is ArgumentException or FileNotFoundException)
{
// Return empty context menu
return null;
Expand Down Expand Up @@ -168,7 +168,7 @@ public async Task InvokeItem(int itemID)

return contextMenu;
}
catch (Exception ex) when (ex is ArgumentException || ex is FileNotFoundException)
catch (Exception ex) when (ex is ArgumentException or FileNotFoundException)
{
// Return empty context menu
return null;
Expand Down Expand Up @@ -259,7 +259,7 @@ private static void EnumMenuItems(
{
cMenu2?.HandleMenuMsg((uint)User32.WindowMessage.WM_INITMENUPOPUP, (IntPtr)mii.hSubMenu, new IntPtr(ii));
}
catch (NotImplementedException)
catch (Exception ex) when (ex is COMException or NotImplementedException)
{
// Only for dynamic/owner drawn? (open with, etc)
}
Expand Down Expand Up @@ -297,15 +297,15 @@ private static void EnumMenuItems(

return commandString.ToString();
}
catch (Exception ex) when (ex is InvalidCastException || ex is ArgumentException)
catch (Exception ex) when (ex is InvalidCastException or ArgumentException)
{
// TODO: Investigate this...
Debug.WriteLine(ex);

return null;
}

catch (Exception ex) when (ex is COMException || ex is NotImplementedException)
catch (Exception ex) when (ex is COMException or NotImplementedException)
{
// Not every item has an associated verb
return null;
Expand Down