Ejemplo n.º 1
0
        private void control_HotkeyChanged(object sender, EventArgs e)
        {
            HotkeySelectionControl control = (HotkeySelectionControl)sender;

            manager.RegisterHotkey(control.Setting);
            RegisterFailedHotkeys();
        }
Ejemplo n.º 2
0
 private void Edit(HotkeySelectionControl selectionControl)
 {
     using (TaskSettingsForm taskSettingsForm = new TaskSettingsForm(selectionControl.Setting.TaskSettings))
     {
         taskSettingsForm.ShowDialog();
         selectionControl.UpdateDescription();
     }
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 7
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();
     }
 }
Ejemplo n.º 8
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();
     }
 }
Ejemplo n.º 9
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();
        }
Ejemplo n.º 10
0
 private void control_SelectedChanged(object sender, EventArgs e)
 {
     Selected = (HotkeySelectionControl)sender;
     UpdateButtons();
     UpdateCheckStates();
 }
Ejemplo n.º 11
0
 private void control_SelectedChanged(object sender, EventArgs e)
 {
     Selected = (HotkeySelectionControl)sender;
     UpdateButtons();
     UpdateCheckStates();
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
     }
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 15
0
 private void Edit(HotkeySelectionControl selectionControl)
 {
     using (TaskSettingsForm taskSettingsForm = new TaskSettingsForm(selectionControl.Setting.TaskSettings))
     {
         taskSettingsForm.ShowDialog();
         selectionControl.UpdateDescription();
     }
 }
Ejemplo n.º 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;
 }