Ejemplo n.º 1
0
 private void ReadConfigFile()
 {
     if (File.Exists(ConfigName))
     {
         Config = JsonConvert.DeserializeObject <NowPlayingConfig>(File.ReadAllText(ConfigName));
     }
     else
     {
         MakeConfigFile();
         Config = JsonConvert.DeserializeObject <NowPlayingConfig>(File.ReadAllText(ConfigName));
     }
 }
Ejemplo n.º 2
0
        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());
        }