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

            s.AllowMultipleInstances = (bool?)e.Attribute("AllowMultipleInstances") ?? false;
            return(s);
        }
示例#2
0
        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
        }
示例#4
0
 public void LoadDefaults()
 {
     currentMiscSettings = new MiscSettings();
     this.DataContext    = currentMiscSettings;
 }