示例#1
0
        public static void BatchSave(SettingValues settingValues)
        {
            var settingsLocation = Settings.Default.SettingsLocation;
            var settingsContents = File.ReadAllText(settingsLocation);
            var jsonObject       = JObject.Parse(settingsContents);

            jsonObject["GameLocation"] = settingValues.GameLocation;

            File.WriteAllText(settingsLocation, jsonObject.ToString());
        }
示例#2
0
        public static SettingValues ReturnAll()
        {
            var settingsLocation = Settings.Default.SettingsLocation;
            var settingsContents = File.ReadAllText(settingsLocation);
            var jsonObject       = JObject.Parse(settingsContents);

            var settingValues = new SettingValues()
            {
                GameLocation = (string)jsonObject["GameLocation"],
            };

            return(settingValues);
        }