示例#1
0
 private void Form1_Load(object sender, EventArgs e)
 {
     Microbreak.InitializeSettings();
     PopulateControlsUnderSettingsTab();
     PopulateControlsUnderAboutTab();
     Microbreak.SetTimeOfNextBreak(this);
 }
示例#2
0
 private void timerMicrobreak_Tick(object sender, EventArgs e)
 {
     if (Microbreak.TimeForABreak())
     {
         BreakStart();
     }
     UpdateTimeUntilNextBreak();
 }
示例#3
0
 private void ResetCountdownToNextBreak()
 {
     Microbreak.SetTimeOfNextBreak(this);
     if (formReminder != null)
     {
         formReminder.Close();
     }
 }
示例#4
0
 private void BreakStart()
 {
     buttonBreakNow.Enabled = false;
     Microbreak.SetEndOfCurrentBreak();
     formReminder = new FormReminder(this);
     formReminder.Show();
     Microbreak._microbreakInProgress = true;
     timerMicrobreak.Stop();
 }
示例#5
0
 private void timerMicrobreakDuration_Tick(object sender, EventArgs e)
 {
     if (Microbreak.endOfCurrentBreak <= DateTime.Now)
     {
         Microbreak.PlayASoundAtEndOfBreak();
         Microbreak.SetTimeOfNextBreak(form1);
         Close();
     }
     UpdateRemainingBreakTime();
 }
示例#6
0
 private void numericUpDownPostponeBreakBy_ValueChanged(object sender, EventArgs e)
 {
     Properties.Settings.Default.PostponeMicrobreakInMinutes = Convert.ToDouble(numericUpDownPostponeBreakBy.Value);
     Properties.Settings.Default.Save();
     Microbreak.InitializeSettings();
 }
示例#7
0
 private void numericUpDownIntervalBetweenBreaks_ValueChanged(object sender, EventArgs e)
 {
     Properties.Settings.Default.IntervalBetweenMicrobreaksInMins = Convert.ToDouble(numericUpDownIntervalBetweenBreaks.Value);
     Properties.Settings.Default.Save();
     Microbreak.InitializeSettings();
 }
示例#8
0
        private void UpdateTimeUntilNextBreak()
        {
            var timeUntilBreak = Microbreak.TimeUntilNextBreak();

            labelTimeUntilNextBreak.Text = string.Format("{0}:{1}", timeUntilBreak.ToString("mm"), timeUntilBreak.ToString("ss"));
        }
示例#9
0
 private void textBoxlocationOfWavFileToPlayAtEndOfBreak_TextChanged(object sender, EventArgs e)
 {
     Properties.Settings.Default.LocationOfWavFileToPlayAtEndOfBreak = textBoxlocationOfWavFileToPlayAtEndOfBreak.Text;
     Properties.Settings.Default.Save();
     Microbreak.InitializeSettings();
 }
示例#10
0
 private void checkBoxPlaySoundAtEndOfBreak_CheckedChanged(object sender, EventArgs e)
 {
     Properties.Settings.Default.PlaySoundAtEndOfBreak = checkBoxPlaySoundAtEndOfBreak.Checked;
     Properties.Settings.Default.Save();
     Microbreak.InitializeSettings();
 }
示例#11
0
 private void checkBoxResetBreakOnWorkstationUnlock_CheckedChanged(object sender, EventArgs e)
 {
     Properties.Settings.Default.ResetBreakOnWorkstationUnlock = checkBoxResetBreakOnWorkstationUnlock.Checked;
     Properties.Settings.Default.Save();
     Microbreak.InitializeSettings();
 }
示例#12
0
        private void UpdateRemainingBreakTime()
        {
            var timeRemainingOfCurrentBreak = Microbreak.TimeRemainingOfCurrentBreak();

            labelBreakTimeRemaining.Text = string.Format("{0}:{1}", timeRemainingOfCurrentBreak.ToString("mm"), timeRemainingOfCurrentBreak.ToString("ss"));
        }
示例#13
0
 private void buttonSkipBreak_Click(object sender, EventArgs e)
 {
     Microbreak.SetTimeOfNextBreak(form1);
     Close();
 }
示例#14
0
 private void buttonPostponeBreak_Click(object sender, EventArgs e)
 {
     Microbreak.PostponeBreak(form1);
     Close();
 }
示例#15
0
 private void FormReminder_Load(object sender, EventArgs e)
 {
     timerMicrobreakDuration.Start();
     Microbreak.PlayASoundAtStartOfBreak();
     form1.MinimizeForm();
 }