Browse Source

Replace WinForms `FolderBrowserDialog` with WPF `OpenFolderDialog`.

pull/3619/head
sonyps5201314 5 months ago
parent
commit
a973b2e71d
  1. 14
      ILSpy/Commands/GeneratePdbContextMenuEntry.cs

14
ILSpy/Commands/GeneratePdbContextMenuEntry.cs

@ -153,17 +153,12 @@ namespace ICSharpCode.ILSpy @@ -153,17 +153,12 @@ namespace ICSharpCode.ILSpy
}
// Ask for target folder
using (var dlg = new System.Windows.Forms.FolderBrowserDialog())
{
dlg.Description = Resources.SelectPDBOutputFolder;
dlg.RootFolder = Environment.SpecialFolder.MyComputer;
dlg.ShowNewFolderButton = true;
// Show dialog on UI thread
System.Windows.Forms.DialogResult result = dlg.ShowDialog();
if (result != System.Windows.Forms.DialogResult.OK || string.IsNullOrWhiteSpace(dlg.SelectedPath))
var dlg = new OpenFolderDialog();
dlg.Title = Resources.SelectPDBOutputFolder;
if (dlg.ShowDialog() != true || string.IsNullOrWhiteSpace(dlg.FolderName))
return;
string targetFolder = dlg.SelectedPath;
string targetFolder = dlg.FolderName;
DecompilationOptions options = dockWorkspace.ActiveTabPage.CreateDecompilationOptions();
dockWorkspace.RunWithCancellation(ct => Task<AvalonEditTextOutput>.Factory.StartNew(() => {
@ -246,7 +241,6 @@ namespace ICSharpCode.ILSpy @@ -246,7 +241,6 @@ namespace ICSharpCode.ILSpy
}, ct)).Then(dockWorkspace.ShowText).HandleExceptions();
}
}
}
[ExportMainMenuCommand(ParentMenuID = nameof(Resources._File), Header = nameof(Resources.GeneratePortable), MenuCategory = nameof(Resources.Save))]
[Shared]

Loading…
Cancel
Save