private AppSettings() { _settingsInfo = new AppSettingsInfo(); _persister = new Data.XmlPersister<AppSettingsInfo>("AppSettingsInfo.xml"); _persister.load(); getSettingsDefault(); }
private void getSettingsDefault() { if ((_settingsInfo.PomodoroDurationMinutes == 0)&&((_persister.objList==null)||(_persister.objList.Count<=0))) { var tmp = new AppSettingsInfo() { PomodoroDurationMinutes=AppConstants.PomodoroDurationMinutesDefault, RestDurationMinutes=AppConstants.RestDurationMinutesDefault, CompletionSoundPath=AppConstants.CompletionSoundDefaultPath, TickerSoundPath=AppConstants.TickerSoundDefaultPath }; _persister.objList.Add(tmp); _persister.save(); _settingsInfo.PomodoroDurationMinutes = AppConstants.PomodoroDurationMinutesDefault; _settingsInfo.RestDurationMinutes = AppConstants.RestDurationMinutesDefault; _settingsInfo.CompletionSoundPath = AppConstants.CompletionSoundDefaultPath; _settingsInfo.TickerSoundPath = AppConstants.TickerSoundDefaultPath; } else { _settingsInfo = _persister.objList.FirstOrDefault(); } }