Browse Source

Fix switching to newly created/cloned assembly list.

pull/1866/head
Siegfried Pammer 6 years ago
parent
commit
70e1053c0a
  1. 11
      ILSpy/AssemblyListManager.cs
  2. 6
      ILSpy/MainWindow.xaml.cs

11
ILSpy/AssemblyListManager.cs

@ -30,7 +30,7 @@ namespace ICSharpCode.ILSpy @@ -30,7 +30,7 @@ namespace ICSharpCode.ILSpy
/// </summary>
sealed class AssemblyListManager
{
readonly ILSpySettings spySettings;
ILSpySettings spySettings;
public AssemblyListManager(ILSpySettings spySettings)
{
@ -47,8 +47,9 @@ namespace ICSharpCode.ILSpy @@ -47,8 +47,9 @@ namespace ICSharpCode.ILSpy
/// Loads an assembly list from the ILSpySettings.
/// If no list with the specified name is found, the default list is loaded instead.
/// </summary>
public AssemblyList LoadList(string listName)
public AssemblyList LoadList(ILSpySettings settings, string listName)
{
this.spySettings = settings;
AssemblyList list = DoLoadList(spySettings, listName);
if (!AssemblyLists.Contains(list.ListName))
AssemblyLists.Add(list.ListName);
@ -65,11 +66,7 @@ namespace ICSharpCode.ILSpy @@ -65,11 +66,7 @@ namespace ICSharpCode.ILSpy
}
}
}
XElement firstList = doc.Elements("List").FirstOrDefault();
if (firstList != null)
return new AssemblyList(firstList);
else
return new AssemblyList(listName ?? DefaultListName);
return new AssemblyList(listName ?? DefaultListName);
}
public bool CloneList(string selectedAssemblyList, string newListName)

6
ILSpy/MainWindow.xaml.cs

@ -477,7 +477,7 @@ namespace ICSharpCode.ILSpy @@ -477,7 +477,7 @@ namespace ICSharpCode.ILSpy
if (loadPreviousAssemblies) {
// Load AssemblyList only in Loaded event so that WPF is initialized before we start the CPU-heavy stuff.
// This makes the UI come up a bit faster.
this.assemblyList = AssemblyListManager.LoadList(sessionSettings.ActiveAssemblyList);
this.assemblyList = AssemblyListManager.LoadList(spySettings, sessionSettings.ActiveAssemblyList);
} else {
this.assemblyList = new AssemblyList(AssemblyListManager.DefaultListName);
AssemblyListManager.ClearAll();
@ -595,7 +595,7 @@ namespace ICSharpCode.ILSpy @@ -595,7 +595,7 @@ namespace ICSharpCode.ILSpy
public void ShowAssemblyList(string name)
{
AssemblyList list = this.AssemblyListManager.LoadList(name);
AssemblyList list = this.AssemblyListManager.LoadList(ILSpySettings.Load(), name);
//Only load a new list when it is a different one
if (list.ListName != CurrentAssemblyList.ListName) {
ShowAssemblyList(list);
@ -916,7 +916,7 @@ namespace ICSharpCode.ILSpy @@ -916,7 +916,7 @@ namespace ICSharpCode.ILSpy
try {
refreshInProgress = true;
var path = GetPathForNode(treeView.SelectedItem as SharpTreeNode);
ShowAssemblyList(AssemblyListManager.LoadList(assemblyList.ListName));
ShowAssemblyList(AssemblyListManager.LoadList(ILSpySettings.Load(), assemblyList.ListName));
SelectNode(FindNodeByPath(path, true));
} finally {
refreshInProgress = false;

Loading…
Cancel
Save