Browse Source

Fix SaveToDisk default filename suggestion to use the text of the tree node instead. The ToString() implementation returns the tree node path, which always starts with the full path of the loaded assembly. So in my case the suggested file name was always "C" when the assembly was located on the C: drive.

pull/3579/head
Siegfried Pammer 3 months ago
parent
commit
a79a587154
  1. 2
      ILSpy/TextView/DecompilerTextView.cs

2
ILSpy/TextView/DecompilerTextView.cs

@ -1091,7 +1091,7 @@ namespace ICSharpCode.ILSpy.TextView
SaveFileDialog dlg = new SaveFileDialog(); SaveFileDialog dlg = new SaveFileDialog();
dlg.DefaultExt = language.FileExtension; dlg.DefaultExt = language.FileExtension;
dlg.Filter = language.Name + "|*" + language.FileExtension + Properties.Resources.AllFiles; dlg.Filter = language.Name + "|*" + language.FileExtension + Properties.Resources.AllFiles;
dlg.FileName = WholeProjectDecompiler.CleanUpFileName(treeNodes.First().ToString(), language.FileExtension); dlg.FileName = WholeProjectDecompiler.CleanUpFileName(treeNodes.First().Text.ToString(), language.FileExtension);
if (dlg.ShowDialog() == true) if (dlg.ShowDialog() == true)
{ {
SaveToDisk(new DecompilationContext(language, treeNodes.ToArray(), options), dlg.FileName); SaveToDisk(new DecompilationContext(language, treeNodes.ToArray(), options), dlg.FileName);

Loading…
Cancel
Save