Ejemplo n.º 1
0
 public override List<string> read(Setting setting) {
     List<string> strings = new List<string>();
     List<XmlElement> nodes = getNodes(setting.path, false);
     foreach (XmlElement node in nodes) {
         strings.Add(node.InnerText);
     }
     return strings;
 }
Ejemplo n.º 2
0
        public override void write(Setting setting, string value) {
            List<string> path = new List<string>(setting.path);
            string name = path[path.Count - 1];
            path.RemoveAt(path.Count - 1);

            XmlElement node = getNodes(path, true)[0];

            XmlElement new_node = config.CreateElement(name);
            new_node.InnerText = value;
            node.AppendChild(new_node);
        }
Ejemplo n.º 3
0
 public override List<string> erase(Setting setting) {
     List<string> strings = new List<string>();
     List<XmlElement> nodes = getNodes(setting.path, false);
     while (nodes.Count > 0) {
         XmlElement node = nodes[0];
         strings.Add(node.InnerText);
         node.ParentNode.RemoveChild(node);
         nodes.Remove(node);
     }
     return strings;
 }
Ejemplo n.º 4
0
 public override bool erase(Setting setting, string value) {
     bool found = false;
     List<XmlElement> nodes = getNodes(setting.path, false);
     while (nodes.Count > 0) {
         XmlElement node = nodes[0];
         if (node.InnerText == value) {
             node.ParentNode.RemoveChild(node);
             found = true;
         }
         nodes.Remove(node);
     }
     return found;
 }
Ejemplo n.º 5
0
 private void NotifyPropertyChanged(Setting setting) {
     foreach (string notify in setting.all_notifications) {
         NotifyPropertyChanged(notify);
     }
 }
Ejemplo n.º 6
0
        protected override SettingsCollection createSettings(SettingsCollection settings)
        {
            settings = base.createSettings(settings);

            Setting new_setting = new Setting("backup_path", null, "paths", "backup");
            new_setting.addAdditionalNotification("IsBackupPathSet");
            new_setting.addAdditionalNotification("backup_path_not_set");
            settings.Add(new_setting);

            new_setting = new Setting("sync_path", null, "paths", "sync");
            new_setting.addAdditionalNotification("any_sync_enabled");
            new_setting.addAdditionalNotification("sync_path_set");
            settings.Add(new_setting);

            new_setting = new Setting("steam_override", null, "paths", "steam_override");
            new_setting.addAdditionalNotification("steam_path");
            settings.Add(new_setting);

            new_setting = new Setting("save_paths", null, "paths", "saves");
            settings.Add(new_setting);

            settings.Add(new Setting("IgnoreDateCheck", false, "date_check", "ignore"));

            settings.Add(new Setting("MonitoredGames", null, "games", "monitor"));

            settings.Add(new Setting("VersioningEnabled", false, "versioning", "enabled"));
            settings.Add(new Setting("VersioningUnit", VersioningUnit.Hours, "versioning", "unit"));
            settings.Add(new Setting("VersioningFrequency", 5, "versioning", "frequency"));
            settings.Add(new Setting("VersioningMax", 100, "versioning", "max"));

            settings.Add(new Setting("SuppressSubmitRequests", false, "suppress", "submit_requests"));
            settings.Add(new Setting("SuppressElevationWarnings", false, "suppress", "elevation_warnings"));

            return settings;
        }
Ejemplo n.º 7
0
 public abstract List<string> erase(Setting setting);
Ejemplo n.º 8
0
 // Erasing existing settings
 public abstract bool erase(Setting setting, string value);
Ejemplo n.º 9
0
 // This ADDS a setting to the stack
 public abstract void write(Setting setting, string value);
Ejemplo n.º 10
0
 public bool overwrite(Setting setting, string old_value, string new_value) {
     bool result = erase(setting, old_value);
     write(setting, new_value);
     return result;
 }
Ejemplo n.º 11
0
 // This erases all the existing settings with the new setting
 public List<string> overwrite(Setting setting, string value) {
     List<string> return_me = read(setting);
     erase(setting);
     write(setting, value);
     return return_me;
 }
Ejemplo n.º 12
0
 public abstract List<string> read(Setting setting);