Browse Source

Fix TabPage.Title, if "Save Code" action is canceled.

pull/3307/head
Siegfried Pammer 10 months ago
parent
commit
c66733f353
  1. 16
      ILSpy/ViewModels/TabPageModel.cs

16
ILSpy/ViewModels/TabPageModel.cs

@ -86,9 +86,20 @@ namespace ICSharpCode.ILSpy.ViewModels @@ -86,9 +86,20 @@ namespace ICSharpCode.ILSpy.ViewModels
textView = new DecompilerTextView();
tabPage.Content = textView;
}
string oldTitle = tabPage.Title;
tabPage.Title = Properties.Resources.Decompiling;
try
{
return action(textView);
}
finally
{
if (tabPage.Title == Properties.Resources.Decompiling)
{
tabPage.Title = oldTitle;
}
}
}
public static void ShowTextView(this TabPageModel tabPage, Action<DecompilerTextView> action)
{
@ -97,8 +108,13 @@ namespace ICSharpCode.ILSpy.ViewModels @@ -97,8 +108,13 @@ namespace ICSharpCode.ILSpy.ViewModels
textView = new DecompilerTextView();
tabPage.Content = textView;
}
string oldTitle = tabPage.Title;
tabPage.Title = Properties.Resources.Decompiling;
action(textView);
if (tabPage.Title == Properties.Resources.Decompiling)
{
tabPage.Title = oldTitle;
}
}
public static void Focus(this TabPageModel tabPage)

Loading…
Cancel
Save