public HotkeySelectionControl(HotkeySettings setting) { InitializeComponent(); Setting = setting; UpdateDescription(); UpdateHotkeyText(); UpdateHotkeyStatus(); }
private HotkeySelectionControl AddHotkeySelectionControl(HotkeySettings hotkeySetting) { HotkeySelectionControl control = new HotkeySelectionControl(hotkeySetting); control.Margin = new Padding(0, 0, 0, 2); control.SelectedChanged += control_SelectedChanged; control.HotkeyChanged += control_HotkeyChanged; control.LabelDoubleClick += control_LabelDoubleClick; flpHotkeys.Controls.Add(control); return(control); }
private void hotkeyForm_HotkeyPress(ushort id, Keys key, Modifiers modifier) { if (!IgnoreHotkeys) { HotkeySettings hotkeySetting = Hotkeys.Find(x => x.HotkeyInfo.ID == id); if (hotkeySetting != null) { OnHotkeyTrigger(hotkeySetting); } } }
private void btnDuplicate_Click(object sender, EventArgs e) { if (Selected != null) { HotkeySettings hotkeySetting = new HotkeySettings(); hotkeySetting.TaskSettings = Selected.Setting.TaskSettings.Copy(); hotkeySetting.TaskSettings.WatchFolderEnabled = false; hotkeySetting.TaskSettings.WatchFolderList = new List <WatchFolderSettings>(); manager.Hotkeys.Add(hotkeySetting); HotkeySelectionControl control = AddHotkeySelectionControl(hotkeySetting); control.Selected = true; Selected = control; UpdateCheckStates(); control.Focus(); } }
private void btnAdd_Click(object sender, EventArgs e) { HotkeySettings hotkeySetting = new HotkeySettings(); hotkeySetting.TaskSettings = TaskSettings.GetDefaultTaskSettings(); manager.Hotkeys.Add(hotkeySetting); HotkeySelectionControl control = AddHotkeySelectionControl(hotkeySetting); control.Selected = true; Selected = control; UpdateButtons(); UpdateCheckStates(); control.Focus(); Update(); EditSelected(); }
public void UnregisterHotkey(HotkeySettings hotkeySetting, bool removeFromList = true) { if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.Registered) { hotkeyForm.UnregisterHotkey(hotkeySetting.HotkeyInfo); if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.NotConfigured) { DebugHelper.WriteLine("Hotkey unregistered: " + hotkeySetting); } else if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.Failed) { DebugHelper.WriteLine("Hotkey unregister failed: " + hotkeySetting); } } if (removeFromList) { Hotkeys.Remove(hotkeySetting); } }
public void RegisterHotkey(HotkeySettings hotkeySetting) { UnregisterHotkey(hotkeySetting, false); if (hotkeySetting.HotkeyInfo.Status != HotkeyStatus.Registered && hotkeySetting.HotkeyInfo.IsValidHotkey) { hotkeyForm.RegisterHotkey(hotkeySetting.HotkeyInfo); if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.Registered) { DebugHelper.WriteLine("Hotkey registered: " + hotkeySetting); } else if (hotkeySetting.HotkeyInfo.Status == HotkeyStatus.Failed) { DebugHelper.WriteLine("Hotkey register failed: " + hotkeySetting); } } if (!Hotkeys.Contains(hotkeySetting)) { Hotkeys.Add(hotkeySetting); } }
private HotkeySelectionControl AddHotkeySelectionControl(HotkeySettings hotkeySetting) { HotkeySelectionControl control = new HotkeySelectionControl(hotkeySetting); control.Margin = new Padding(0, 0, 0, 2); control.SelectedChanged += control_SelectedChanged; control.HotkeyChanged += control_HotkeyChanged; control.LabelDoubleClick += control_LabelDoubleClick; flpHotkeys.Controls.Add(control); return control; }
private HotkeySelectionControl FindSelectionControl(HotkeySettings hotkeySetting) { return flpHotkeys.Controls.Cast<HotkeySelectionControl>().FirstOrDefault(hsc => hsc.Setting == hotkeySetting); }
private void btnDuplicate_Click(object sender, EventArgs e) { if (Selected != null) { HotkeySettings hotkeySetting = new HotkeySettings(); hotkeySetting.TaskSettings = Selected.Setting.TaskSettings.Copy(); hotkeySetting.TaskSettings.WatchFolderEnabled = false; hotkeySetting.TaskSettings.WatchFolderList = new List<WatchFolderSettings>(); manager.Hotkeys.Add(hotkeySetting); HotkeySelectionControl control = AddHotkeySelectionControl(hotkeySetting); control.Selected = true; Selected = control; UpdateCheckStates(); control.Focus(); } }
private HotkeySelectionControl FindSelectionControl(HotkeySettings hotkeySetting) { return(flpHotkeys.Controls.Cast <HotkeySelectionControl>().FirstOrDefault(hsc => hsc.Setting == hotkeySetting)); }
protected void OnHotkeyTrigger(HotkeySettings hotkeySetting) { if (HotkeyTrigger != null) { HotkeyTrigger(hotkeySetting); } }