private void ReadConfigFile() { if (File.Exists(ConfigName)) { Config = JsonConvert.DeserializeObject <NowPlayingConfig>(File.ReadAllText(ConfigName)); } else { MakeConfigFile(); Config = JsonConvert.DeserializeObject <NowPlayingConfig>(File.ReadAllText(ConfigName)); } }
public void SaveConfigFile(NowPlayingConfig SettingsOnExit) { dynamic Settings = new JObject(); Settings.CfgText = Config.CfgText; Settings.IsDebugModeEnabled = Config.IsDebugModeEnabled; Settings.LastUsedKey = SettingsOnExit.LastUsedKey; Settings.IsAutoSendEnabled = SettingsOnExit.IsAutoSendEnabled; Settings.IsNightModeEnabled = SettingsOnExit.IsNightModeEnabled; File.WriteAllText(ConfigName, Settings.ToString()); }