Browse Source

Fix #1297: Clean workpane on deleting last item in treeview

pull/1317/head
Siegfried Pammer 7 years ago
parent
commit
175c76ea0b
  1. 24
      ILSpy/MainWindow.xaml.cs

24
ILSpy/MainWindow.xaml.cs

@ -48,6 +48,7 @@ namespace ICSharpCode.ILSpy
/// </summary> /// </summary>
partial class MainWindow : Window partial class MainWindow : Window
{ {
bool refreshInProgress;
readonly NavigationHistory<NavigationState> history = new NavigationHistory<NavigationState>(); readonly NavigationHistory<NavigationState> history = new NavigationHistory<NavigationState>();
ILSpySettings spySettings; ILSpySettings spySettings;
internal SessionSettings sessionSettings; internal SessionSettings sessionSettings;
@ -748,9 +749,14 @@ namespace ICSharpCode.ILSpy
void RefreshCommandExecuted(object sender, ExecutedRoutedEventArgs e) void RefreshCommandExecuted(object sender, ExecutedRoutedEventArgs e)
{ {
var path = GetPathForNode(treeView.SelectedItem as SharpTreeNode); try {
ShowAssemblyList(assemblyListManager.LoadList(ILSpySettings.Load(), assemblyList.ListName)); refreshInProgress = true;
SelectNode(FindNodeByPath(path, true)); var path = GetPathForNode(treeView.SelectedItem as SharpTreeNode);
ShowAssemblyList(assemblyListManager.LoadList(ILSpySettings.Load(), assemblyList.ListName));
SelectNode(FindNodeByPath(path, true));
} finally {
refreshInProgress = false;
}
} }
void SearchCommandExecuted(object sender, ExecutedRoutedEventArgs e) void SearchCommandExecuted(object sender, ExecutedRoutedEventArgs e)
@ -773,7 +779,10 @@ namespace ICSharpCode.ILSpy
void DecompileSelectedNodes(DecompilerTextViewState state = null, bool recordHistory = true) void DecompileSelectedNodes(DecompilerTextViewState state = null, bool recordHistory = true)
{ {
if (ignoreDecompilationRequests || treeView.SelectedItems.Count == 0) if (ignoreDecompilationRequests)
return;
if (treeView.SelectedItems.Count == 0 && refreshInProgress)
return; return;
if (recordHistory) { if (recordHistory) {
@ -804,7 +813,12 @@ namespace ICSharpCode.ILSpy
public void RefreshDecompiledView() public void RefreshDecompiledView()
{ {
DecompileSelectedNodes(); try {
refreshInProgress = true;
DecompileSelectedNodes();
} finally {
refreshInProgress = false;
}
} }
public DecompilerTextView TextView { public DecompilerTextView TextView {

Loading…
Cancel
Save