Example #1
0
        public static MiscSettings LoadMiscSettings(ILSpySettings settings)
        {
            XElement e = settings["MiscSettings"];
            var      s = new MiscSettings();

            s.AllowMultipleInstances = (bool?)e.Attribute("AllowMultipleInstances") ?? false;
            return(s);
        }
Example #2
0
        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
        }