Browse Source

#2657: Properly set ApplyWinRTProjections and UseDebugSymbols settings on loaded assemblies.

pull/2660/head
Siegfried Pammer 3 years ago
parent
commit
ed88a230a5
  1. 2
      ICSharpCode.ILSpyX/AssemblyList.cs
  2. 20
      ICSharpCode.ILSpyX/AssemblyListManager.cs
  3. 5
      ILSpy/MainWindow.xaml.cs
  4. 2
      ILSpy/Options/DecompilerSettingsPanel.xaml.cs

2
ICSharpCode.ILSpyX/AssemblyList.cs

@ -76,6 +76,8 @@ namespace ICSharpCode.ILSpyX @@ -76,6 +76,8 @@ namespace ICSharpCode.ILSpyX
{
this.manager = manager ?? throw new ArgumentNullException(nameof(manager));
this.listName = listName;
this.ApplyWinRTProjections = manager.ApplyWinRTProjections;
this.UseDebugSymbols = manager.UseDebugSymbols;
ownerThread = Thread.CurrentThread;
synchronizationContext = SynchronizationContext.Current;
assemblies.CollectionChanged += Assemblies_CollectionChanged;

20
ICSharpCode.ILSpyX/AssemblyListManager.cs

@ -84,36 +84,24 @@ namespace ICSharpCode.ILSpyX @@ -84,36 +84,24 @@ namespace ICSharpCode.ILSpyX
{
if ((string)list.Attribute("name") == listName)
{
return new AssemblyList(this, list) {
UseDebugSymbols = UseDebugSymbols,
ApplyWinRTProjections = ApplyWinRTProjections
};
return new AssemblyList(this, list);
}
}
}
return new AssemblyList(this, listName ?? DefaultListName) {
UseDebugSymbols = UseDebugSymbols,
ApplyWinRTProjections = ApplyWinRTProjections
};
return new AssemblyList(this, listName ?? DefaultListName);
}
public bool CloneList(string selectedAssemblyList, string newListName)
{
var list = DoLoadList(selectedAssemblyList);
var newList = new AssemblyList(list, newListName) {
UseDebugSymbols = UseDebugSymbols,
ApplyWinRTProjections = ApplyWinRTProjections
};
var newList = new AssemblyList(list, newListName);
return AddListIfNotExists(newList);
}
public bool RenameList(string selectedAssemblyList, string newListName)
{
var list = DoLoadList(selectedAssemblyList);
var newList = new AssemblyList(list, newListName) {
UseDebugSymbols = UseDebugSymbols,
ApplyWinRTProjections = ApplyWinRTProjections
};
var newList = new AssemblyList(list, newListName);
return DeleteList(selectedAssemblyList) && AddListIfNotExists(newList);
}

5
ILSpy/MainWindow.xaml.cs

@ -105,7 +105,10 @@ namespace ICSharpCode.ILSpy @@ -105,7 +105,10 @@ namespace ICSharpCode.ILSpy
var spySettings = ILSpySettings.Load();
this.spySettingsForMainWindow_Loaded = spySettings;
this.sessionSettings = new SessionSettings(spySettings);
this.AssemblyListManager = new AssemblyListManager(spySettings);
this.AssemblyListManager = new AssemblyListManager(spySettings) {
ApplyWinRTProjections = Options.DecompilerSettingsPanel.CurrentDecompilerSettings.ApplyWindowsRuntimeProjections,
UseDebugSymbols = Options.DecompilerSettingsPanel.CurrentDecompilerSettings.UseDebugSymbols
};
// Make sure Images are initialized on the UI thread.
this.Icon = Images.ILSpyIcon;

2
ILSpy/Options/DecompilerSettingsPanel.xaml.cs

@ -82,6 +82,8 @@ namespace ICSharpCode.ILSpy.Options @@ -82,6 +82,8 @@ namespace ICSharpCode.ILSpy.Options
root.Add(section);
currentDecompilerSettings = newSettings;
MainWindow.Instance.AssemblyListManager.ApplyWinRTProjections = newSettings.ApplyWindowsRuntimeProjections;
MainWindow.Instance.AssemblyListManager.UseDebugSymbols = newSettings.UseDebugSymbols;
}
private void OnGroupChecked(object sender, RoutedEventArgs e)

Loading…
Cancel
Save