Пример #1
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDsTextViewRoles.ReplEditor) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.CtrlShift(Key.C, ReplIds.CopyCode.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Enter, ReplIds.Submit.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Enter, ReplIds.NewLineDontSubmit.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.L, ReplIds.ClearScreen.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Up, ReplIds.SelectPreviousCommand.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Down, ReplIds.SelectNextCommand.ToCommandInfo()));

            yield return(CommandShortcut.CtrlAlt(Key.Up, ReplIds.SelectSameTextPreviousCommand.ToCommandInfo()));

            yield return(CommandShortcut.CtrlAlt(Key.Down, ReplIds.SelectSameTextNextCommand.ToCommandInfo()));
        }
Пример #2
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedTextViewRoles.Analyzable) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.CtrlShift(Key.Down, TextReferenceIds.MoveToNextReference.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Up, TextReferenceIds.MoveToPreviousReference.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Down, TextReferenceIds.MoveToNextDefinition.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Up, TextReferenceIds.MoveToPreviousDefinition.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.F12, TextReferenceIds.FollowReference.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.F12, TextReferenceIds.FollowReferenceNewTab.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.OemCloseBrackets, TextReferenceIds.MoveToMatchingBrace.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.OemCloseBrackets, TextReferenceIds.MoveToMatchingBraceSelect.ToCommandInfo()));
        }
Пример #3
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDsTextViewRoles.OutputTextPane) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Control(Key.L, OutputTextPaneIds.ClearAll.ToCommandInfo()));
        }
Пример #4
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDnSpyTextViewRoles.CodeEditor) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Control(Key.P, EditCodeIds.Compile.ToCommandInfo()));
        }
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDsTextViewRoles.RoslynRepl) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Control(Key.S, RoslynReplIds.SaveText.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.S, RoslynReplIds.SaveCode.ToCommandInfo()));
        }
Пример #6
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            if (!(target is HexView))
            {
                yield break;
            }

            yield return(CommandShortcut.Control(Key.G, HexCommandIds.GoToPosition.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.L, HexCommandIds.Select.ToCommandInfo()));

            yield return(CommandShortcut.CtrlAlt(Key.S, HexCommandIds.SaveSelection.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.R, HexCommandIds.ToggleUseRelativePositions.ToCommandInfo()));
        }
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDsTextViewRoles.DocumentViewer) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Create(Key.Tab, TextReferenceIds.MoveToNextReference.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Tab, TextReferenceIds.MoveToPreviousReference.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Enter, TextReferenceIds.FollowReference.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Enter, TextReferenceIds.FollowReferenceNewTab.ToCommandInfo()));
        }
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDsTextViewRoles.DocumentViewer) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Create(KeyInput.CtrlAlt(Key.V), KeyInput.Create(Key.A), DebuggerToolWindowIds.ShowAutos.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.CtrlAlt(Key.W), KeyInput.Create(Key.D1), DebuggerToolWindowIds.ShowWatch1.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.CtrlAlt(Key.W), KeyInput.Create(Key.D2), DebuggerToolWindowIds.ShowWatch2.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.CtrlAlt(Key.W), KeyInput.Create(Key.D3), DebuggerToolWindowIds.ShowWatch3.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.CtrlAlt(Key.W), KeyInput.Create(Key.D4), DebuggerToolWindowIds.ShowWatch4.ToCommandInfo()));
        }
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDsTextViewRoles.CodeEditor) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Create(Key.F6, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.F7, EditCodeIds.Compile.ToCommandInfo()));

            // Shift+F8 is used to move to the previous diagnostic
            //yield return CommandShortcut.Shift(Key.F8, EditCodeIds.Compile.ToCommandInfo());
            yield return(CommandShortcut.CtrlShift(Key.B, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.CtrlAlt(Key.F7, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.F8, EditCodeIds.Compile.ToCommandInfo()));
        }
Пример #10
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDnSpyTextViewRoles.CodeEditor) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Create(Key.F6, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.F7, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.F8, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.B, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.CtrlAlt(Key.F7, EditCodeIds.Compile.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.F8, EditCodeIds.Compile.ToCommandInfo()));
        }
Пример #11
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            yield return(CommandShortcut.Control(Key.Z, StandardIds.Undo.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Back, StandardIds.Undo.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Y, StandardIds.Redo.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Z, StandardIds.Redo.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.Back, StandardIds.Redo.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.X, StandardIds.Cut.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Delete, StandardIds.Cut.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.C, StandardIds.Copy.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Insert, StandardIds.Copy.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.V, StandardIds.Paste.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Insert, StandardIds.Paste.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.F, StandardIds.Find.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.H, StandardIds.Replace.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.I, StandardIds.IncrementalSearch.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.I, StandardIds.IncrementalSearchBackward.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.F3, StandardIds.FindNext.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.F3, StandardIds.FindPrevious.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.F3, StandardIds.FindNextSelected.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.F3, StandardIds.FindPreviousSelected.ToCommandInfo()));
        }
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            if (!(target is ITextView))
            {
                yield break;
            }

            yield return(CommandShortcut.Create(Key.Back, TextEditorIds.BACKSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Back, TextEditorIds.BACKSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Tab, TextEditorIds.BACKTAB.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.BOL.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.BOL_EXT.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.BOL_EXT_COL.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.PageDown, TextEditorIds.BOTTOMLINE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.PageDown, TextEditorIds.BOTTOMLINE_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Escape, TextEditorIds.CANCEL.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.L, TextEditorIds.CUTLINE.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Delete, TextEditorIds.DELETE.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.DELETEBLANKLINES.ToCommandInfo());
            yield return(CommandShortcut.CtrlShift(Key.L, TextEditorIds.DELETELINE.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.DELETETOBOL.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.DELETETOEOL.ToCommandInfo());
            //yield return CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.OemBackslash), TextEditorIds.DELETEWHITESPACE.ToCommandInfo());
            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Create(Key.OemBackslash), TextEditorIds.DELETEWHITESPACE.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Control(Key.OemBackslash), TextEditorIds.DELETEWHITESPACE.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Back, TextEditorIds.DELETEWORDLEFT.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Delete, TextEditorIds.DELETEWORDRIGHT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Down, TextEditorIds.DOWN.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Down, TextEditorIds.DOWN_EXT.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.Down, TextEditorIds.DOWN_EXT_COL.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.ECMD_CONVERTSPACESTOTABS.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.ECMD_CONVERTTABSTOSPACES.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.EditorLineFirstColumn.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.EditorLineFirstColumnExtend.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.End, TextEditorIds.END.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.End, TextEditorIds.END_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.End, TextEditorIds.EOL.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.End, TextEditorIds.EOL_EXT.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.End, TextEditorIds.EOL_EXT_COL.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Home, TextEditorIds.BOL.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Home, TextEditorIds.BOL_EXT.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.FIRSTNONWHITENEXT.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.FIRSTNONWHITEPREV.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.OemCloseBrackets, TextEditorIds.GOTOBRACE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.OemCloseBrackets, TextEditorIds.GOTOBRACE_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.G, TextEditorIds.GOTOLINE.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Home, TextEditorIds.HOME.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Home, TextEditorIds.HOME_EXT.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.INDENT.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.LASTCHAR.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.LASTCHAR_EXT.ToCommandInfo());
            yield return(CommandShortcut.Create(Key.Left, TextEditorIds.LEFT.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Left, TextEditorIds.LEFT_EXT.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.Left, TextEditorIds.LEFT_EXT_COL.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Down, TextEditorIds.MoveSelLinesDown.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Up, TextEditorIds.MoveSelLinesUp.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Enter, TextEditorIds.OPENLINEABOVE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Enter, TextEditorIds.OPENLINEBELOW.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.PageDown, TextEditorIds.PAGEDN.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.PageDown, TextEditorIds.PAGEDN_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.PageUp, TextEditorIds.PAGEUP.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.PageUp, TextEditorIds.PAGEUP_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Enter, TextEditorIds.RETURN.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Right, TextEditorIds.RIGHT.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Right, TextEditorIds.RIGHT_EXT.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.Right, TextEditorIds.RIGHT_EXT_COL.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SCROLLBOTTOM.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SCROLLCENTER.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.Down, TextEditorIds.SCROLLDN.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SCROLLLEFT.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SCROLLPAGEDN.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SCROLLPAGEUP.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SCROLLRIGHT.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SCROLLTOP.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.Up, TextEditorIds.SCROLLUP.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.A, TextEditorIds.SELECTALL.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.W, TextEditorIds.SELECTCURRENTWORD.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.W, TextEditorIds.SELECTCURRENTWORD.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.U, TextEditorIds.SELLOWCASE.ToCommandInfo()));

            //yield return CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.A), TextEditorIds.SELSWAPANCHOR.ToCommandInfo());
            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Create(Key.A), TextEditorIds.SELSWAPANCHOR.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Control(Key.A), TextEditorIds.SELSWAPANCHOR.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Q, TextEditorIds.SELTABIFY.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SELTITLECASE.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.SELTOGGLECASE.ToCommandInfo());
            yield return(CommandShortcut.CtrlShift(Key.Q, TextEditorIds.SELUNTABIFY.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.U, TextEditorIds.SELUPCASE.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Enter, TextEditorIds.SmartBreakLine.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Tab, TextEditorIds.TAB.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Insert, TextEditorIds.TOGGLE_OVERTYPE_MODE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.D8, TextEditorIds.TOGGLEVISSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.R), KeyInput.Control(Key.W), TextEditorIds.TOGGLEVISSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Create(Key.S), TextEditorIds.TOGGLEVISSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Control(Key.S), TextEditorIds.TOGGLEVISSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Create(Key.W), TextEditorIds.TOGGLEWORDWRAP.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Control(Key.W), TextEditorIds.TOGGLEWORDWRAP.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Right, TextEditorIds.COMPLETEWORD.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Space, TextEditorIds.COMPLETEWORD.ToCommandInfo()));

            //yield return CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.W), TextEditorIds.COMPLETEWORD.ToCommandInfo());
            //yield return CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.W), TextEditorIds.COMPLETEWORD.ToCommandInfo());
            yield return(CommandShortcut.CtrlAlt(Key.T, TextEditorIds.SHOWMEMBERLIST.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.J, TextEditorIds.SHOWMEMBERLIST.ToCommandInfo()));

            //yield return CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.L), TextEditorIds.SHOWMEMBERLIST.ToCommandInfo());
            //yield return CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.L), TextEditorIds.SHOWMEMBERLIST.ToCommandInfo());
            yield return(CommandShortcut.CtrlAlt(Key.Space, TextEditorIds.ToggleConsumeFirstCompletionMode.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.PageUp, TextEditorIds.TOPLINE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.PageUp, TextEditorIds.TOPLINE_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.T, TextEditorIds.TRANSPOSECHAR.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.T, TextEditorIds.TRANSPOSELINE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.T, TextEditorIds.TRANSPOSEWORD.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, TextEditorIds.UNINDENT.ToCommandInfo());
            yield return(CommandShortcut.Create(Key.Up, TextEditorIds.UP.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Up, TextEditorIds.UP_EXT.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.Up, TextEditorIds.UP_EXT_COL.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Right, TextEditorIds.WORDNEXT.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Right, TextEditorIds.WORDNEXT_EXT.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShiftAlt(Key.Right, TextEditorIds.WORDNEXT_EXT_COL.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Left, TextEditorIds.WORDPREV.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Left, TextEditorIds.WORDPREV_EXT.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShiftAlt(Key.Left, TextEditorIds.WORDPREV_EXT_COL.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.OemPeriod, TextEditorIds.ZoomIn.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.OemPlus, TextEditorIds.ZoomIn.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Add, TextEditorIds.ZoomIn.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.OemComma, TextEditorIds.ZoomOut.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.OemMinus, TextEditorIds.ZoomOut.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Subtract, TextEditorIds.ZoomOut.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.D0, TextEditorIds.ZoomReset.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.NumPad0, TextEditorIds.ZoomReset.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.OemComma, TextEditorIds.DECREASEFILTER.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.OemPeriod, TextEditorIds.INCREASEFILTER.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.I), TextEditorIds.QUICKINFO.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.I), TextEditorIds.QUICKINFO.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Space, TextEditorIds.PARAMINFO.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.P), TextEditorIds.PARAMINFO.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.P), TextEditorIds.PARAMINFO.ToCommandInfo()));
        }
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            var textView = target as ITextView;

            if (textView?.Roles.Contains(PredefinedDsTextViewRoles.DocumentViewer) != true)
            {
                yield break;
            }

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.W), BookmarkIds.ShowBookmarkWindow.ToCommandInfo()));

            //yield return CommandShortcut.Create(Key.XXXXXXXXXXXX, BookmarkIds.ClearAllBookmarksInDocument.ToCommandInfo());

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.L), BookmarkIds.ClearBookmarks.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Control(Key.C), BookmarkIds.ClearBookmarks.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Create(Key.C), BookmarkIds.ClearBookmarks.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.F2, BookmarkIds.ClearBookmarks.ToCommandInfo()));

            //yield return CommandShortcut.Create(Key.XXXXXXXXXXXX, BookmarkIds.EnableAllBookmarks.ToCommandInfo());

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Control(Key.E), BookmarkIds.EnableBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Create(Key.E), BookmarkIds.EnableBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.K), BookmarkIds.ToggleBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.F2, BookmarkIds.ToggleBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Control(Key.T), BookmarkIds.ToggleBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Create(Key.T), BookmarkIds.ToggleBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.T), BookmarkIds.ToggleBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.T), BookmarkIds.ToggleBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.F2, BookmarkIds.NextBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.N), BookmarkIds.NextBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.N), BookmarkIds.NextBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Control(Key.N), BookmarkIds.NextBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Create(Key.N), BookmarkIds.NextBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.F2, BookmarkIds.PreviousBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.P), BookmarkIds.PreviousBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.P), BookmarkIds.PreviousBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Control(Key.P), BookmarkIds.PreviousBookmark.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.B), KeyInput.Create(Key.P), BookmarkIds.PreviousBookmark.ToCommandInfo()));

            //yield return CommandShortcut.Create(Key.XXXXXXXXXXXX, BookmarkIds.NextBookmarkInDocument.ToCommandInfo());
            //yield return CommandShortcut.Create(Key.XXXXXXXXXXXX, BookmarkIds.PreviousBookmarkInDocument.ToCommandInfo());

            //yield return CommandShortcut.Create(Key.XXXXXXXXXXXX, BookmarkIds.NextBookmarkWithSameLabel.ToCommandInfo());
            //yield return CommandShortcut.Create(Key.XXXXXXXXXXXX, BookmarkIds.PreviousBookmarkWithSameLabel.ToCommandInfo());
        }
Пример #14
0
        public IEnumerable <CommandShortcut> GetCommandShortcuts(object target)
        {
            if (!(target is HexView))
            {
                yield break;
            }

            yield return(CommandShortcut.Create(Key.Back, HexEditorIds.BACKSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Back, HexEditorIds.BACKSPACE.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Tab, HexEditorIds.BACKTAB.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.BOL.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.BOL_EXT.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.PageDown, HexEditorIds.BOTTOMLINE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.PageDown, HexEditorIds.BOTTOMLINE_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Escape, HexEditorIds.CANCEL.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Delete, HexEditorIds.DELETE.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.DELETEBLANKLINES.ToCommandInfo());
            yield return(CommandShortcut.CtrlShift(Key.L, HexEditorIds.DELETELINE.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.DELETETOBOL.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.DELETETOEOL.ToCommandInfo());
            yield return(CommandShortcut.Create(Key.Down, HexEditorIds.DOWN.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Down, HexEditorIds.DOWN_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.End, HexEditorIds.END.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.End, HexEditorIds.END_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.End, HexEditorIds.EOL.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.End, HexEditorIds.EOL_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Home, HexEditorIds.BOL.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Home, HexEditorIds.BOL_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Home, HexEditorIds.HOME.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Home, HexEditorIds.HOME_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Left, HexEditorIds.LEFT.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Left, HexEditorIds.LEFT_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.PageDown, HexEditorIds.PAGEDN.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.PageDown, HexEditorIds.PAGEDN_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.PageUp, HexEditorIds.PAGEUP.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.PageUp, HexEditorIds.PAGEUP_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Enter, HexEditorIds.RETURN.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Right, HexEditorIds.RIGHT.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Right, HexEditorIds.RIGHT_EXT.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.SCROLLBOTTOM.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.SCROLLCENTER.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.Down, HexEditorIds.SCROLLDN.ToCommandInfo()));

            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.SCROLLLEFT.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.SCROLLPAGEDN.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.SCROLLPAGEUP.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.SCROLLRIGHT.ToCommandInfo());
            //TODO: yield return CommandShortcut.Control(Key.XXXXX, HexEditorIds.SCROLLTOP.ToCommandInfo());
            yield return(CommandShortcut.Control(Key.Up, HexEditorIds.SCROLLUP.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.A, HexEditorIds.SELECTALL.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.W, HexEditorIds.SELECTCURRENTWORD.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.W, HexEditorIds.SELECTCURRENTWORD.ToCommandInfo()));

            //yield return CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.A), HexEditorIds.SELSWAPANCHOR.ToCommandInfo());
            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Create(Key.A), HexEditorIds.SELSWAPANCHOR.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.E), KeyInput.Control(Key.A), HexEditorIds.SELSWAPANCHOR.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Tab, HexEditorIds.TAB.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Insert, HexEditorIds.TOGGLE_OVERTYPE_MODE.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.PageUp, HexEditorIds.TOPLINE.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.PageUp, HexEditorIds.TOPLINE_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.Up, HexEditorIds.UP.ToCommandInfo()));

            yield return(CommandShortcut.Shift(Key.Up, HexEditorIds.UP_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Right, HexEditorIds.WORDNEXT.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Right, HexEditorIds.WORDNEXT_EXT.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Left, HexEditorIds.WORDPREV.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.Left, HexEditorIds.WORDPREV_EXT.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.OemPeriod, HexEditorIds.ZoomIn.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.OemPlus, HexEditorIds.ZoomIn.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Add, HexEditorIds.ZoomIn.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.OemComma, HexEditorIds.ZoomOut.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.OemMinus, HexEditorIds.ZoomOut.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.Subtract, HexEditorIds.ZoomOut.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.D0, HexEditorIds.ZoomReset.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.NumPad0, HexEditorIds.ZoomReset.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.OemComma, HexEditorIds.DECREASEFILTER.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.OemPeriod, HexEditorIds.INCREASEFILTER.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.I), HexEditorIds.QUICKINFO.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.I), HexEditorIds.QUICKINFO.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.C, HexEditorIds.CopyText.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.D8, HexEditorIds.CopyUtf8String.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.U, HexEditorIds.CopyUnicodeString.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.H, HexEditorIds.CopyCSharpArray.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.B, HexEditorIds.CopyVisualBasicArray.ToCommandInfo()));

            yield return(CommandShortcut.CtrlAlt(Key.O, HexEditorIds.CopyOffset.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.D8, HexEditorIds.PasteUtf8String.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.D8), HexEditorIds.PasteUtf8String7BitEncodedLengthPrefix.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.D8), HexEditorIds.PasteUtf8String7BitEncodedLengthPrefix.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.U, HexEditorIds.PasteUnicodeString.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Create(Key.U), HexEditorIds.PasteUnicodeString7BitEncodedLengthPrefix.ToCommandInfo()));

            yield return(CommandShortcut.Create(KeyInput.Control(Key.K), KeyInput.Control(Key.U), HexEditorIds.PasteUnicodeString7BitEncodedLengthPrefix.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.B, HexEditorIds.PasteBlob.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.D, HexEditorIds.ShowAllBytes.ToCommandInfo()));

            yield return(CommandShortcut.Control(Key.D, HexEditorIds.ShowOnlySelectedBytes.ToCommandInfo()));

            yield return(CommandShortcut.Create(Key.F5, HexEditorIds.Refresh.ToCommandInfo()));

            yield return(CommandShortcut.CtrlShift(Key.A, HexEditorIds.SelectAllBytesBlock.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Up, HexEditorIds.MoveToPreviousValidStartEnd.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.Up, HexEditorIds.MoveToPreviousValidStartEndExt.ToCommandInfo()));

            yield return(CommandShortcut.Alt(Key.Down, HexEditorIds.MoveToNextValidStartEnd.ToCommandInfo()));

            yield return(CommandShortcut.ShiftAlt(Key.Down, HexEditorIds.MoveToNextValidStartEndExt.ToCommandInfo()));
        }