@@ -62,7 +62,7 @@ public async Task<bool> InvokeVerb(string? verb)
62
62
63
63
return true ;
64
64
}
65
- catch ( Exception ex ) when ( ex is COMException || ex is UnauthorizedAccessException )
65
+ catch ( Exception ex ) when ( ex is COMException or UnauthorizedAccessException )
66
66
{
67
67
Debug . WriteLine ( ex ) ;
68
68
}
@@ -90,7 +90,7 @@ public async Task InvokeItem(int itemID)
90
90
91
91
Win32API . BringToForeground ( currentWindows ) ;
92
92
}
93
- catch ( Exception ex ) when ( ex is COMException || ex is UnauthorizedAccessException )
93
+ catch ( Exception ex ) when ( ex is COMException or UnauthorizedAccessException )
94
94
{
95
95
Debug . WriteLine ( ex ) ;
96
96
}
@@ -110,7 +110,7 @@ public async Task InvokeItem(int itemID)
110
110
shellItems . Add ( ShellFolderExtensions . GetShellItemFromPathOrPidl ( fp ) ) ;
111
111
return GetContextMenuForFiles ( shellItems . ToArray ( ) , flags , owningThread , itemFilter ) ;
112
112
}
113
- catch ( Exception ex ) when ( ex is ArgumentException || ex is FileNotFoundException )
113
+ catch ( Exception ex ) when ( ex is ArgumentException or FileNotFoundException )
114
114
{
115
115
// Return empty context menu
116
116
return null ;
@@ -168,7 +168,7 @@ public async Task InvokeItem(int itemID)
168
168
169
169
return contextMenu ;
170
170
}
171
- catch ( Exception ex ) when ( ex is ArgumentException || ex is FileNotFoundException )
171
+ catch ( Exception ex ) when ( ex is ArgumentException or FileNotFoundException )
172
172
{
173
173
// Return empty context menu
174
174
return null ;
@@ -259,7 +259,7 @@ private static void EnumMenuItems(
259
259
{
260
260
cMenu2 ? . HandleMenuMsg ( ( uint ) User32 . WindowMessage . WM_INITMENUPOPUP , ( IntPtr ) mii . hSubMenu , new IntPtr ( ii ) ) ;
261
261
}
262
- catch ( NotImplementedException )
262
+ catch ( Exception ex ) when ( ex is COMException or NotImplementedException )
263
263
{
264
264
// Only for dynamic/owner drawn? (open with, etc)
265
265
}
@@ -297,15 +297,15 @@ private static void EnumMenuItems(
297
297
298
298
return commandString . ToString ( ) ;
299
299
}
300
- catch ( Exception ex ) when ( ex is InvalidCastException || ex is ArgumentException )
300
+ catch ( Exception ex ) when ( ex is InvalidCastException or ArgumentException )
301
301
{
302
302
// TODO: Investigate this...
303
303
Debug . WriteLine ( ex ) ;
304
304
305
305
return null ;
306
306
}
307
307
308
- catch ( Exception ex ) when ( ex is COMException || ex is NotImplementedException )
308
+ catch ( Exception ex ) when ( ex is COMException or NotImplementedException )
309
309
{
310
310
// Not every item has an associated verb
311
311
return null ;
0 commit comments