/// <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 (TimerPopup.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!"); TimerPopup quickTimer = new TimerPopup(); quickTimer.Show(); } if (TimerCheck.Instance == null && UCTimer.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!"); TimerCheck check = new TimerCheck(); check.Show(); } }
private void TimerCheck_FormClosed(object sender, FormClosedEventArgs e) { instance = null; }
/// <summary> /// Creates a new TimerCheck form displaying all currently running timers /// </summary> public TimerCheck() { InitializeComponent(); this.MaximumSize = new Size(315, 375); instance = this; }