void SaveSetting <T>(TwoFilesConfiguration configuration, MainSettings savedSettings, string setting, T runningValue) { if (!savedSettings.GetValue(setting).Equals(runningValue)) { configuration.SetValue(setting, runningValue); } }
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); } }