예제 #1
0
        /// <summary>
        /// Gets the collection of default gestures for the specified command.
        /// </summary>
        private static InputGestureCollection GetInputGestures(String name)
        {
            var gestures = new InputGestureCollection();

            switch (name)
            {
            case nameof(ScrollPageUp):
                gestures.Add(new KeyGesture(Key.PageUp, ModifierKeys.None, "PageUp"));
                break;

            case nameof(ScrollPageDown):
                gestures.Add(new KeyGesture(Key.PageDown, ModifierKeys.None, "PageDown"));
                break;

            case nameof(MoveLeft):
                gestures.Add(new KeyGesture(Key.Left, ModifierKeys.None, "Left"));
                gestures.Add(new GamePadGesture(GamePadButton.LeftStickLeft, 0, "LeftStickLeft"));
                break;

            case nameof(MoveRight):
                gestures.Add(new KeyGesture(Key.Right, ModifierKeys.None, "Right"));
                gestures.Add(new GamePadGesture(GamePadButton.LeftStickRight, 0, "LeftStickRight"));
                break;

            case nameof(MoveUp):
                gestures.Add(new KeyGesture(Key.Up, ModifierKeys.None, "Up"));
                gestures.Add(new GamePadGesture(GamePadButton.LeftStickUp, 0, "LeftStickUp"));
                break;

            case nameof(MoveDown):
                gestures.Add(new KeyGesture(Key.Down, ModifierKeys.None, "Down"));
                gestures.Add(new GamePadGesture(GamePadButton.LeftStickDown, 0, "LeftStickDown"));
                break;

            case nameof(MoveToHome):
                gestures.Add(new KeyGesture(Key.Home, ModifierKeys.None, "Home"));
                break;

            case nameof(MoveToEnd):
                gestures.Add(new KeyGesture(Key.End, ModifierKeys.None, "End"));
                break;

            case nameof(MoveToPageUp):
                gestures.Add(new KeyGesture(Key.PageUp, ModifierKeys.None, "PageUp"));
                break;

            case nameof(MoveToPageDown):
                gestures.Add(new KeyGesture(Key.PageDown, ModifierKeys.None, "PageDown"));
                break;

            case nameof(ExtendSelectionUp):
                gestures.Add(new KeyGesture(Key.Up, ModifierKeys.Shift, "Shift+Up"));
                break;

            case nameof(ExtendSelectionDown):
                gestures.Add(new KeyGesture(Key.Down, ModifierKeys.Shift, "Shift+Down"));
                break;

            case nameof(ExtendSelectionLeft):
                gestures.Add(new KeyGesture(Key.Left, ModifierKeys.Shift, "Shift+Left"));
                break;

            case nameof(ExtendSelectionRight):
                gestures.Add(new KeyGesture(Key.Right, ModifierKeys.Shift, "Shift+Right"));
                break;

            case nameof(SelectToHome):
                gestures.Add(new KeyGesture(Key.Home, ModifierKeys.Shift, "Shift+Home"));
                break;

            case nameof(SelectToEnd):
                gestures.Add(new KeyGesture(Key.End, ModifierKeys.Shift, "Shift+End"));
                break;

            case nameof(SelectToPageUp):
                gestures.Add(new KeyGesture(Key.PageUp, ModifierKeys.Shift, "Shift+PageUp"));
                break;

            case nameof(SelectToPageDown):
                gestures.Add(new KeyGesture(Key.PageDown, ModifierKeys.Shift, "Shift+PageDown"));
                break;

            case nameof(MoveFocusUp):
                gestures.Add(new KeyGesture(Key.Up, ModifierKeys.Control, "Ctrl+Up"));
                break;

            case nameof(MoveFocusDown):
                gestures.Add(new KeyGesture(Key.Down, ModifierKeys.Control, "Ctrl+Down"));
                break;

            case nameof(MoveFocusForward):
                gestures.Add(new KeyGesture(Key.Right, ModifierKeys.Control, "Ctrl+Right"));
                break;

            case nameof(MoveFocusBack):
                gestures.Add(new KeyGesture(Key.Left, ModifierKeys.Control, "Ctrl+Left"));
                break;

            case nameof(MoveFocusPageUp):
                gestures.Add(new KeyGesture(Key.PageUp, ModifierKeys.Control, "Ctrl+PageUp"));
                break;

            case nameof(MoveFocusPageDown):
                gestures.Add(new KeyGesture(Key.PageDown, ModifierKeys.Control, "Ctrl+PageDown"));
                break;
            }

            return(gestures);
        }
예제 #2
0
        /// <summary>
        /// Gets the collection of default gestures for the specified command.
        /// </summary>
        private static InputGestureCollection GetInputGestures(String name)
        {
            var gestures = new InputGestureCollection();

            switch (name)
            {
            case nameof(Cut):
                gestures.Add(new KeyGesture(Key.X, ModifierKeys.Control, "Ctrl+X"));
                gestures.Add(new KeyGesture(Key.Delete, ModifierKeys.Shift, "Shift+Delete"));
                break;

            case nameof(Copy):
                gestures.Add(new KeyGesture(Key.C, ModifierKeys.Control, "Ctrl+C"));
                gestures.Add(new KeyGesture(Key.Insert, ModifierKeys.Control, "Ctrl+Insert"));
                break;

            case nameof(Paste):
                gestures.Add(new KeyGesture(Key.V, ModifierKeys.Control, "Ctrl+V"));
                gestures.Add(new KeyGesture(Key.Insert, ModifierKeys.Shift, "Shift+Insert"));
                break;

            case nameof(Delete):
                gestures.Add(new KeyGesture(Key.Delete, ModifierKeys.None, "Del"));
                break;

            case nameof(Undo):
                gestures.Add(new KeyGesture(Key.Z, ModifierKeys.Control, "Ctrl+Z"));
                break;

            case nameof(Redo):
                gestures.Add(new KeyGesture(Key.Y, ModifierKeys.Control, "Ctrl+Y"));
                break;

            case nameof(Find):
                gestures.Add(new KeyGesture(Key.F, ModifierKeys.Control, "Ctrl+F"));
                break;

            case nameof(Replace):
                gestures.Add(new KeyGesture(Key.H, ModifierKeys.Control, "Ctrl+H"));
                break;

            case nameof(SelectAll):
                gestures.Add(new KeyGesture(Key.A, ModifierKeys.Control, "Ctrl+A"));
                break;

            case nameof(Help):
                gestures.Add(new KeyGesture(Key.F1, ModifierKeys.None, "F1"));
                break;

            case nameof(New):
                gestures.Add(new KeyGesture(Key.N, ModifierKeys.Control, "Ctrl+N"));
                break;

            case nameof(Open):
                gestures.Add(new KeyGesture(Key.O, ModifierKeys.Control, "Ctrl+O"));
                break;

            case nameof(Save):
                gestures.Add(new KeyGesture(Key.S, ModifierKeys.Control, "Ctrl+S"));
                break;

            case nameof(Print):
                gestures.Add(new KeyGesture(Key.P, ModifierKeys.Control, "Ctrl+P"));
                break;

            case nameof(PrintPreview):
                gestures.Add(new KeyGesture(Key.F2, ModifierKeys.Control, "Ctrl+F2"));
                break;

            case nameof(Properties):
                gestures.Add(new KeyGesture(Key.F4, ModifierKeys.None, "F4"));
                break;

            case nameof(ContextMenu):
                gestures.Add(new KeyGesture(Key.F10, ModifierKeys.Shift, "Shift+F10"));
                gestures.Add(new KeyGesture(Key.Application, ModifierKeys.None, "Apps"));
                break;

            case nameof(Stop):
                gestures.Add(new KeyGesture(Key.Escape, ModifierKeys.None, "Esc"));
                break;
            }

            return(gestures);
        }