Example #1
0
 private void RegisterAliases(IEnumerable <Shortcut> shortcuts, ShortcutAction action)
 {
     foreach (Shortcut shortcut in shortcuts)
     {
         RegisterAction(shortcut, action);
     }
 }
Example #2
0
 public override void PerformAction(ShortcutAction action)
 {
     if (action == ShortcutAction.ShowColumnChooser)
     {
         dgInvBomclientGrid.View.ShowColumnChooser();
     }
     base.PerformAction(action);
 }
Example #3
0
        public void RegisterAction(Shortcut shortcut, ICommand command, params Shortcut[] aliasShortcuts)
        {
            ShortcutAction _action = new ShortcutAction {
                command = command
            };

            RegisterAction(shortcut, _action);
            RegisterAliases(aliasShortcuts, _action);
        }
Example #4
0
        public void RegisterAction(Shortcut shortcut, Action action, params Shortcut[] aliasShortcuts)
        {
            ShortcutAction _action = new ShortcutAction {
                directAction = action
            };

            RegisterAction(shortcut, _action);
            RegisterAliases(aliasShortcuts, _action);
        }
Example #5
0
        public void RegisterAction(Shortcut shortcut, Button commandButton, params Shortcut[] aliasShortcuts)
        {
            ShortcutAction action = new ShortcutAction {
                command = commandButton.Command
            };

            RegisterAction(shortcut, action);
            RegisterAliases(aliasShortcuts, action);
        }
Example #6
0
 private void ExecuteAction(ShortcutAction sa)
 {
     if (sa != null)
     {
         SelectedAction = sa.action;
         DialogResult = DialogResult.OK;
         Close();
     }
 }
Example #7
0
        public void AddAction(Keys key, string description, Action action)
        {
            var sa = new ShortcutAction { key = key, description = description, action = action };
            _actions.Add(sa);

            var lvi = new ListViewItem(key.ToString());
            lvi.SubItems.Add(description);
            lvi.Tag = sa;
            lstActions.Items.Add(lvi);
        }
Example #8
0
 public KeyboardShortcut(string id, Keys key, Keys modifiers,
                         ShortcutAction action, string label = null)
 {
     this.Id        = id;
     this.Label     = label;
     this.key       = key;
     this.modifiers = modifiers;
     this.Action    = action;
     this.UpdateHandler();
     this.Enabled = true;
 }
Example #9
0
        private void HandleShortcutAction(ShortcutAction action)
        {
            TelemetryExtension.Current?.TrackEvent($"Launch_FromJumpList_QuickAdd" + (action == ShortcutAction.AddTask ? "Task" : "Event"));

            // This works unless there's currently a popup open (like view task is open)
            // So the fact that the shared code clears all popups and then adds a popup messes things up...
            // My iOS code doesn't like all popups being cleared and then a new popup being added immediately...
            HandleLaunch(async(viewModel) =>
            {
                switch (action)
                {
                case ShortcutAction.AddTask:
                    await viewModel.HandleQuickAddTask();
                    break;

                case ShortcutAction.AddEvent:
                    await viewModel.HandleQuickAddEvent();
                    break;
                }
            });
        }
Example #10
0
 public void RegisterAction(Shortcut shortcut, ShortcutAction action, params Shortcut[] aliasShortcuts)
 {
     action.SetBusyState = shortcut.SetBusyState;
     Actions[shortcut]   = action;
     RegisterAliases(aliasShortcuts, action);
 }