public List <IdNamePair> LoadAll() { string[] lines = { }; try { this.EnsureFileExists(); lines = File.ReadAllLines(PresetManager.SavedTimersPath); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); return(null); } this.savedSettings.Clear(); var idNamePairs = new List <IdNamePair>(); foreach (var line in lines) { var setting = SimpleTimerSettings.ParseCsv(line); var id = setting.Id; if (this.HasSetting(id)) { this.UpdateSetting(id, setting); } else { this.AddNewSetting(id, setting); } idNamePairs.Add(new IdNamePair(id, setting.Name)); } return(idNamePairs); }
public bool RemoveTimer(string timerString) { return(this.RemoveTimer(SimpleTimerSettings.ParseCsv(timerString))); }
public void AddTimer(string timerString) { this.AddTimer(SimpleTimerSettings.ParseCsv(timerString)); }