private void restoreSettings() { SettingsSaver ss = new SettingsSaver(); int savedBreakLength = ss.getBreakLength(); int savedWorkLength = ss.getWorkLength(); String savedAlarmPath = ss.getAlarmPath(); if (savedBreakLength > 0) { countdown.setBreakLength(savedBreakLength); breakNumber.Value = savedBreakLength; } if (savedWorkLength > 0) { countdown.setWorkLength(savedWorkLength * 60); timerNumber.Value = savedWorkLength; } if (savedAlarmPath != "") { countdown.setAlarmFile(savedAlarmPath); alarmFilePathTextBox.Text = savedAlarmPath; } }
private void SaveSettingsOnFormClose(object sender, FormClosingEventArgs e) { SettingsSaver ss = new SettingsSaver(); ss.setBreakLength(int.Parse(breakNumber.Value.ToString())); ss.setWorkLength(int.Parse(timerNumber.Value.ToString())); ss.setAlarmPath(alarmFilePathTextBox.Text.ToString()); ss.saveSettings(); }