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

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

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