File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -656,6 +656,10 @@ await Win32API.StartSTATask(() =>
656
656
}
657
657
}
658
658
}
659
+ catch ( InvalidOperationException )
660
+ {
661
+ // Invalid file path
662
+ }
659
663
}
660
664
661
665
private static bool HandleCommandLineArgs ( )
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public static async Task<string> GetFileAssociation(string filename)
43
43
}
44
44
45
45
// Find desktop apps
46
- var lpResult = new StringBuilder ( ) ;
46
+ var lpResult = new StringBuilder ( 2048 ) ;
47
47
var hResult = Shell32 . FindExecutable ( filename , null , lpResult ) ;
48
48
if ( hResult . ToInt64 ( ) > 32 )
49
49
{
Original file line number Diff line number Diff line change @@ -485,10 +485,6 @@ private async void OpenSelectedItems(bool displayApplicationPicker)
485
485
}
486
486
else if ( selectedItemCount > 1 )
487
487
{
488
- foreach ( ListedItem clickedOnItem in CurrentInstance . ContentPage . SelectedItems . Where ( x => x . PrimaryItemAttribute == StorageItemTypes . Folder ) )
489
- {
490
- await MainPage . AddNewTab ( typeof ( ModernShellPage ) , ( clickedOnItem as ShortcutItem ) ? . TargetPath ?? clickedOnItem . ItemPath ) ;
491
- }
492
488
foreach ( ListedItem clickedOnItem in CurrentInstance . ContentPage . SelectedItems . Where ( x => x . PrimaryItemAttribute == StorageItemTypes . File
493
489
&& ! x . IsShortcutItem ) )
494
490
{
@@ -510,6 +506,10 @@ private async void OpenSelectedItems(bool displayApplicationPicker)
510
506
var applicationPath = string . Join ( '|' , CurrentInstance . ContentPage . SelectedItems . Where ( x => x . PrimaryItemAttribute == StorageItemTypes . File ) . Select ( x => x . ItemPath ) ) ;
511
507
await InvokeWin32Component ( applicationPath ) ;
512
508
}
509
+ foreach ( ListedItem clickedOnItem in CurrentInstance . ContentPage . SelectedItems . Where ( x => x . PrimaryItemAttribute == StorageItemTypes . Folder ) )
510
+ {
511
+ await MainPage . AddNewTab ( typeof ( ModernShellPage ) , ( clickedOnItem as ShortcutItem ) ? . TargetPath ?? clickedOnItem . ItemPath ) ;
512
+ }
513
513
}
514
514
}
515
515
catch ( FileNotFoundException )
You can’t perform that action at this time.
0 commit comments