public HotkeySelectionControl(HotkeySettings setting)
 {
     InitializeComponent();
     Setting = setting;
     UpdateDescription();
     UpdateHotkeyText();
     UpdateHotkeyStatus();
 }
 public HotkeySelectionControl(HotkeySettings setting)
 {
     InitializeComponent();
     Setting = setting;
     UpdateDescription();
     UpdateHotkeyText();
     UpdateHotkeyStatus();
 }
Example #3
0
        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);
        }
Example #4
0
        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);
                }
            }
        }
Example #5
0
 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();
     }
 }
Example #6
0
        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();
        }
Example #7
0
        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);
            }
        }
Example #8
0
        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);
            }
        }
Example #9
0
 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;
 }
Example #10
0
 private HotkeySelectionControl FindSelectionControl(HotkeySettings hotkeySetting)
 {
     return flpHotkeys.Controls.Cast<HotkeySelectionControl>().FirstOrDefault(hsc => hsc.Setting == hotkeySetting);
 }
Example #11
0
 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();
     }
 }
Example #12
0
 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();
 }
Example #13
0
 private HotkeySelectionControl FindSelectionControl(HotkeySettings hotkeySetting)
 {
     return(flpHotkeys.Controls.Cast <HotkeySelectionControl>().FirstOrDefault(hsc => hsc.Setting == hotkeySetting));
 }
Example #14
0
 protected void OnHotkeyTrigger(HotkeySettings hotkeySetting)
 {
     if (HotkeyTrigger != null)
     {
         HotkeyTrigger(hotkeySetting);
     }
 }
Example #15
0
        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);
            }
        }
Example #16
0
        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);
            }
        }