Esempio n. 1
0
        private void BreakTimer_Tick(object sender, EventArgs e)
        {
            if (minutesLeft <= 0 && secondsLeft <= 0)
            {
                BreakTimer.Stop();

                PreFocusPage preFocus = new PreFocusPage();
                preFocus.Show();
                preFocus.SetDesktopLocation(this.Bounds.X, this.Bounds.Y);
                preFocus.Activate();

                if (hideTaskbar)
                {
                    Taskbar.Hide();
                }
                this.Hide();
            }

            if (minutesLeft != 0 && secondsLeft == 0)
            {
                minutesLeft--;
                secondsLeft = 59;
            }
            else
            {
                secondsLeft--;
            }

            BreakTimerLabel.Text = minutesLeft + ":" + secondsLeft.ToString().PadLeft(2, '0');
        }
Esempio n. 2
0
        public void Stop()
        {
            Timer.Stop();
            BreakTimer.Stop();

            IsRunning = false;
        }
Esempio n. 3
0
        private void SetupButton_Click(object sender, EventArgs e)
        {
            SetupPage setup = new SetupPage();

            setup.Show();
            setup.SetDesktopLocation(this.Bounds.X, this.Bounds.Y);

            BreakTimer.Stop();
            this.Hide();
        }
Esempio n. 4
0
        private void CompleteBreak()
        {
            BreakTimer.Stop();

            CurrentPosition++;

            Timer.Interval = Doros[CurrentPosition].Duration;
            Timer.Start();

            IsBreak = false;

            DoroStartTime = DateTime.Now;

            Tick(new DoroTimerEvent(DoroTimerEvent.STARTED_DORO, Doros[CurrentPosition]));
        }