Exemplo 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');
        }
Exemplo n.º 2
0
        private void SetupStartButton_Click(object sender, EventArgs e)
        {
            data.Property("focusTime").Value   = FocusPromptTextBox.Text;
            data.Property("breakTime").Value   = BreakPromptTextBox.Text;
            data.Property("taskbarHide").Value = TaskbarCheckBox.Checked;
            File.WriteAllText(Storage.storagePath, data.ToString());

            if (TaskbarCheckBox.Checked)
            {
                Taskbar.Hide();
            }

            PreFocusPage preFocus = new PreFocusPage();

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

            this.Hide();
        }