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()); }
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); }