public static MiscSettings LoadMiscSettings(ILSpySettings settings) { XElement e = settings["MiscSettings"]; var s = new MiscSettings(); s.AllowMultipleInstances = (bool?)e.Attribute("AllowMultipleInstances") ?? false; return(s); }
public static MiscSettings LoadMiscSettings(ILSpySettings settings) { XElement e = settings["MiscSettings"]; var s = new MiscSettings(); s.AllowMultipleInstances = (bool?)e.Attribute("AllowMultipleInstances") ?? false; s.LoadPreviousAssemblies = (bool?)e.Attribute(nameof(s.LoadPreviousAssemblies)) ?? true; return(s); }
public void Save(XElement root) { var s = (MiscSettings)this.DataContext; var section = new XElement("MiscSettings"); section.SetAttributeValue("AllowMultipleInstances", s.AllowMultipleInstances); XElement existingElement = root.Element("MiscSettings"); if (existingElement != null) { existingElement.ReplaceWith(section); } else { root.Add(section); } currentMiscSettings = null; // invalidate cached settings }
public void LoadDefaults() { currentMiscSettings = new MiscSettings(); this.DataContext = currentMiscSettings; }