///<summary> ///</summary> public MainWindow() { InitializeComponent(); AppKeys.Initialize(); _alarmedDragonEvent = new AlarmedEventTrigger("Dragon", new List <Keys> { Keys.LControlKey, Keys.Oemtilde }, new List <Keys> { Keys.LControlKey, Keys.Z }, 19, new List <int> { 15, 10, 5 }, 30, true, new List <bool> { true, true, true, true }, "Dragon in ", false, "Dragon is up", this); _testEvent = new AlarmedEventTrigger("test", new List <Keys> { Keys.LControlKey, Keys.X }, new List <Keys> { Keys.LControlKey, Keys.Z }, 19, new List <int> { 15, 10, 5 }, 30, true, new List <bool> { true, true, true }, "test in ", false, "test is up", this); _appEvents.Add(_alarmedDragonEvent); _appEvents.Add(_testEvent); }
private void AddFirstShortcutKey() { _firstShortcutKey = new ComboBox { Location = new Point(_basePoint.X + _currentX, _basePoint.Y), Size = KeyComboBoxSize, TabIndex = _tabIndex++ }; _firstShortcutKey.Items.AddRange(AppKeys.GetStringValues()); _firstShortcutKey.SelectedIndex = AppKeys.GetKeyPosition(_keyCombinationStart[0]); _firstShortcutKey.DropDownStyle = ComboBoxStyle.DropDownList; _firstShortcutKey.SelectedIndexChanged += ShortcutComboBoxSelectedIndexChanged; _currentX += _firstShortcutKey.Size.Width; _mainWindow.Controls.Add(_firstShortcutKey); }
private void ActionComboBoxSelectedIndexChanged(object sender, EventArgs e) { _alarmedEventTrigger.SetKeycombinationAction(new List <Keys> { AppKeys.GetKeyFromStringValue(_firstShortcutActionKey.SelectedItem.ToString()), AppKeys.GetKeyFromStringValue(_secondShortcutActionKey.SelectedItem.ToString()) }); }