Beispiel #1
0
 private void RecentFilesWidget_RecentFilesOpenLocationInvoked(object sender, UserControls.PathNavigationEventArgs e)
 {
     AppInstance.NavigateWithArguments(FolderSettings.GetLayoutType(e.ItemPath), new NavigationArguments()
     {
         NavPathParam = e.ItemPath
     });
 }
Beispiel #2
0
 private void RecentFilesWidget_RecentFilesOpenLocationInvoked(object sender, UserControls.PathNavigationEventArgs e)
 {
     AppInstance.ContentFrame.Navigate(e.LayoutType, new NavigationArguments()
     {
         NavPathParam = e.ItemPath, AssociatedTabInstance = AppInstance
     });
 }
Beispiel #3
0
 private async void RecentFilesWidget_RecentFileInvoked(object sender, UserControls.PathNavigationEventArgs e)
 {
     try
     {
         var directoryName = Path.GetDirectoryName(e.ItemPath);
         await AppInstance.InteractionOperations.InvokeWin32ComponentAsync(e.ItemPath, workingDir : directoryName);
     }
     catch (UnauthorizedAccessException)
     {
         var consentDialog = new ConsentDialog();
         await consentDialog.ShowAsync();
     }
     catch (ArgumentException)
     {
         if (new DirectoryInfo(e.ItemPath).Root.ToString().Contains(@"C:\"))
         {
             AppInstance.ContentFrame.Navigate(FolderSettings.GetLayoutType(e.ItemPath), new NavigationArguments()
             {
                 AssociatedTabInstance = AppInstance,
                 NavPathParam          = e.ItemPath
             });
         }
         else
         {
             foreach (DriveItem drive in Enumerable.Concat(App.DrivesManager.Drives, AppSettings.CloudDrivesManager.Drives))
             {
                 if (drive.Path.ToString() == new DirectoryInfo(e.ItemPath).Root.ToString())
                 {
                     AppInstance.ContentFrame.Navigate(FolderSettings.GetLayoutType(e.ItemPath), new NavigationArguments()
                     {
                         AssociatedTabInstance = AppInstance,
                         NavPathParam          = e.ItemPath
                     });
                     return;
                 }
             }
         }
     }
     catch (COMException)
     {
         await DialogDisplayHelper.ShowDialogAsync(
             "DriveUnpluggedDialog/Title".GetLocalized(),
             "DriveUnpluggedDialog/Text".GetLocalized());
     }
 }