Esempio n. 1
0
 /// <summary>
 /// Creates a new TimerCheck form displaying all currently running timers
 /// </summary>
 public MaterialTimerCheck()
 {
     this.StatusBarHeight = 0;
     InitializeComponent();
     this.MaximumSize = new Size(315, 375);
     instance         = this;
 }
Esempio n. 2
0
        /// <summary>
        /// Looks for key combinations to launch the timer form (to set a timer quickly)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">The keyeventargs which contains the pressed keys</param>
        private void GlobalKeyPressDown(object sender, KeyEventArgs e)
        {
            if (!e.Shift && !e.Control && !e.Alt) //None of the key key's (get it?) pressed? return.
            {
                return;
            }

            if (BLLocalDatabase.Setting.Settings.EnableQuickTimer != 1) //Not enabled? don't do anything
            {
                return;
            }

            //Good! now let's check if the KeyCode is not alt shift or ctrl
            if (e.KeyCode == Keys.Alt || e.KeyCode == Keys.ControlKey || e.KeyCode == Keys.ShiftKey)
            {
                return;
            }

            timerHotkey      = BLLocalDatabase.Hotkey.TimerPopup;
            timerCheckHotKey = BLLocalDatabase.Hotkey.TimerCheck;

            if (MaterialTimerPopup.Instance == null && e.Modifiers.ToString().Replace(" ", string.Empty) == timerHotkey.Modifiers && e.KeyCode.ToString() == timerHotkey.Key)
            {
                //Don't allow other applications to also fire this key combination, ctrl+shift+r would for example reload the page at the same time
                e.Handled = true;

                BLIO.Log("Timer hotkey combination pressed!");
                MaterialTimerPopup quickTimer = new MaterialTimerPopup();
                quickTimer.ShowDialog();
            }
            if (MaterialTimerCheck.Instance == null && MUCTimer.RunningTimers.Count > 0 && e.Modifiers.ToString().Replace(" ", string.Empty) == timerCheckHotKey.Modifiers && e.KeyCode.ToString() == timerCheckHotKey.Key)
            {
                //Don't allow other applications to also fire this key combination, ctrl+shift+r would for example reload the page at the same time
                e.Handled = true;

                BLIO.Log("Timer check hotkey combination pressed!");
                MaterialTimerCheck check = new MaterialTimerCheck();
                materialSkinManager.AddFormToManage(check);
                check.Show();
            }
        }
Esempio n. 3
0
 private void TimerCheck_FormClosed(object sender, FormClosedEventArgs e)
 {
     MaterialSkinManager.Instance.RemoveFormToManage(this);
     instance = null;
 }