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

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

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