Browse Source

Fix bug overwriting settings default values on first load.

pull/1596/head
Siegfried Pammer 7 years ago
parent
commit
5c9b3233cd
  1. 4
      ILSpy/Options/DecompilerSettingsPanel.xaml.cs

4
ILSpy/Options/DecompilerSettingsPanel.xaml.cs

@ -54,7 +54,9 @@ namespace ICSharpCode.ILSpy.Options @@ -54,7 +54,9 @@ namespace ICSharpCode.ILSpy.Options
var properties = typeof(Decompiler.DecompilerSettings).GetProperties()
.Where(p => p.GetCustomAttribute<BrowsableAttribute>()?.Browsable != false);
foreach (var p in properties) {
p.SetValue(newSettings, (bool?)e.Attribute(p.Name) ?? true);
var value = (bool?)e.Attribute(p.Name);
if (value.HasValue)
p.SetValue(newSettings, value.Value);
}
return newSettings;
}

Loading…
Cancel
Save