示例#1
0
        private void control_HotkeyChanged(object sender, EventArgs e)
        {
            HotkeySelectionControl control = (HotkeySelectionControl)sender;

            manager.RegisterHotkey(control.Setting);
            RegisterFailedHotkeys();
        }
 private void Edit(HotkeySelectionControl selectionControl)
 {
     using (TaskSettingsForm taskSettingsForm = new TaskSettingsForm(selectionControl.Setting.TaskSettings))
     {
         taskSettingsForm.ShowDialog();
         selectionControl.UpdateDescription();
     }
 }
 private void btnReset_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show(Resources.HotkeySettingsForm_Reset_all_hotkeys_to_defaults_Confirmation, "ShareX", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         manager.ResetHotkeys();
         AddControls();
         Selected = null;
         UpdateButtons();
     }
 }
 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 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.EditRequested   += control_EditRequested;
            flpHotkeys.Controls.Add(control);
            return(control);
        }
示例#6
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);
        }
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (Selected != null)
     {
         manager.UnregisterHotkey(Selected.Setting);
         HotkeySelectionControl hsc = FindSelectionControl(Selected.Setting);
         if (hsc != null)
         {
             flpHotkeys.Controls.Remove(hsc);
         }
         Selected = null;
         UpdateButtons();
     }
 }
 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();
        }
 private void control_SelectedChanged(object sender, EventArgs e)
 {
     Selected = (HotkeySelectionControl)sender;
     UpdateButtons();
     UpdateCheckStates();
 }
示例#11
0
 private void control_SelectedChanged(object sender, EventArgs e)
 {
     Selected = (HotkeySelectionControl)sender;
     UpdateButtons();
     UpdateCheckStates();
 }
示例#12
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();
     }
 }
示例#13
0
 private void btnRemove_Click(object sender, EventArgs e)
 {
     if (Selected != null)
     {
         manager.UnregisterHotkey(Selected.Setting);
         HotkeySelectionControl hsc = FindSelectionControl(Selected.Setting);
         if (hsc != null) flpHotkeys.Controls.Remove(hsc);
         Selected = null;
         UpdateButtons();
     }
 }
示例#14
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();
 }
示例#15
0
 private void Edit(HotkeySelectionControl selectionControl)
 {
     using (TaskSettingsForm taskSettingsForm = new TaskSettingsForm(selectionControl.Setting.TaskSettings))
     {
         taskSettingsForm.ShowDialog();
         selectionControl.UpdateDescription();
     }
 }
示例#16
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.EditRequested += control_EditRequested;
     flpHotkeys.Controls.Add(control);
     return control;
 }