public static MiscSettings LoadMiscSettings(ILSpySettings settings) { XElement e = settings["MiscSettings"]; var s = new MiscSettings(); s.AllowMultipleInstances = (bool?)e.Attribute("AllowMultipleInstances") ?? false; 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 }