Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
        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();
        }