private void RegisterAliases(IEnumerable <Shortcut> shortcuts, ShortcutAction action) { foreach (Shortcut shortcut in shortcuts) { RegisterAction(shortcut, action); } }
public override void PerformAction(ShortcutAction action) { if (action == ShortcutAction.ShowColumnChooser) { dgInvBomclientGrid.View.ShowColumnChooser(); } base.PerformAction(action); }
public void RegisterAction(Shortcut shortcut, ICommand command, params Shortcut[] aliasShortcuts) { ShortcutAction _action = new ShortcutAction { command = command }; RegisterAction(shortcut, _action); RegisterAliases(aliasShortcuts, _action); }
public void RegisterAction(Shortcut shortcut, Action action, params Shortcut[] aliasShortcuts) { ShortcutAction _action = new ShortcutAction { directAction = action }; RegisterAction(shortcut, _action); RegisterAliases(aliasShortcuts, _action); }
public void RegisterAction(Shortcut shortcut, Button commandButton, params Shortcut[] aliasShortcuts) { ShortcutAction action = new ShortcutAction { command = commandButton.Command }; RegisterAction(shortcut, action); RegisterAliases(aliasShortcuts, action); }
private void ExecuteAction(ShortcutAction sa) { if (sa != null) { SelectedAction = sa.action; DialogResult = DialogResult.OK; Close(); } }
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); }
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; }
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; } }); }
public void RegisterAction(Shortcut shortcut, ShortcutAction action, params Shortcut[] aliasShortcuts) { action.SetBusyState = shortcut.SetBusyState; Actions[shortcut] = action; RegisterAliases(aliasShortcuts, action); }