From 0469352e1eb5974103d30892b167c81a080c7f83 Mon Sep 17 00:00:00 2001 From: Ed Harvey Date: Thu, 12 Mar 2015 17:32:33 +1100 Subject: [PATCH] fix #574: "Add To Main List" context menu updates not always persisted across program runs --- ILSpy/AssemblyList.cs | 15 +++++++++++++++ ILSpy/TreeNodes/AssemblyTreeNode.cs | 1 + 2 files changed, 16 insertions(+) diff --git a/ILSpy/AssemblyList.cs b/ILSpy/AssemblyList.cs index 43c0d1316..a32a06291 100644 --- a/ILSpy/AssemblyList.cs +++ b/ILSpy/AssemblyList.cs @@ -117,6 +117,21 @@ namespace ICSharpCode.ILSpy ); } } + + internal void RefreshSave() + { + if (!dirty) { + dirty = true; + App.Current.Dispatcher.BeginInvoke( + DispatcherPriority.Background, + new Action( + delegate { + dirty = false; + AssemblyListManager.SaveList(this); + }) + ); + } + } internal void ClearCache() { diff --git a/ILSpy/TreeNodes/AssemblyTreeNode.cs b/ILSpy/TreeNodes/AssemblyTreeNode.cs index 400873e6e..89a17eae6 100644 --- a/ILSpy/TreeNodes/AssemblyTreeNode.cs +++ b/ILSpy/TreeNodes/AssemblyTreeNode.cs @@ -375,6 +375,7 @@ namespace ICSharpCode.ILSpy.TreeNodes node.RaisePropertyChanged("Foreground"); } } + MainWindow.Instance.CurrentAssemblyList.RefreshSave(); } } }