Example #1
0
 void SaveSetting <T>(TwoFilesConfiguration configuration, MainSettings savedSettings,
                      string setting, T runningValue)
 {
     if (!savedSettings.GetValue(setting).Equals(runningValue))
     {
         configuration.SetValue(setting, runningValue);
     }
 }
Example #2
0
        void SaveListSetting(TwoFilesConfiguration configuration, MainSettings savedSettings,
                             string setting, List <string> runningList)
        {
            var savedList = savedSettings.GetValue(setting);

            if (savedList != null && !savedList.Equals(runningList))
            {
                var listAsString = string.Join(",", runningList);
                configuration.SetValue(setting, listAsString);
            }
        }