예제 #1
0
        private int ExecuteVisualStudio97(ref Guid pguidCmdGroup, uint commandId, uint executeInformation, IntPtr pvaIn, IntPtr pvaOut, ITextBuffer subjectBuffer, IContentType contentType)
        {
            int    result                   = VSConstants.S_OK;
            var    guidCmdGroup             = pguidCmdGroup;
            Action executeNextCommandTarget = () =>
            {
                result = NextCommandTarget.Exec(ref guidCmdGroup, commandId, executeInformation, pvaIn, pvaOut);
            };

            switch ((VSConstants.VSStd97CmdID)commandId)
            {
            case VSConstants.VSStd97CmdID.GotoDefn:
                ExecuteGoToDefinition(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd97CmdID.Paste:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecutePaste(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd97CmdID.Delete:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteDelete(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd97CmdID.SelectAll:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteSelectAll(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            default:
                return(NextCommandTarget.Exec(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut));
            }

            return(result);
        }
예제 #2
0
        protected virtual int ExecuteVisualStudio2000(ref Guid pguidCmdGroup, uint commandId, uint executeInformation, IntPtr pvaIn, IntPtr pvaOut, ITextBuffer subjectBuffer, IContentType contentType)
        {
            int    result                   = VSConstants.S_OK;
            var    guidCmdGroup             = pguidCmdGroup;
            Action executeNextCommandTarget = () =>
            {
                result = NextCommandTarget.Exec(ref guidCmdGroup, commandId, executeInformation, pvaIn, pvaOut);
            };

            switch ((VSConstants.VSStd2KCmdID)commandId)
            {
            case VSConstants.VSStd2KCmdID.TYPECHAR:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteTypeCharacter(pvaIn, subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.RETURN:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteReturn(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.UP:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteUp(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.DOWN:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteDown(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.PAGEDN:
                ExecutePageDown(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.PAGEUP:
                ExecutePageUp(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.CANCEL:
                ExecuteCancel(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.BACKSPACE:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteBackspace(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.DELETE:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteDelete(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.FORMATDOCUMENT:
                ExecuteFormatDocument(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.FORMATSELECTION:
                ExecuteFormatSelection(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case CmdidToggleConsumeFirstMode:
                ExecuteToggleConsumeFirstMode(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case CmdidNextHighlightedReference:
                ExecuteNextHighlightedReference(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case CmdidPreviousHighlightedReference:
                ExecutePreviousHighlightedReference(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.COMMENTBLOCK:
            case VSConstants.VSStd2KCmdID.COMMENT_BLOCK:
                ExecuteCommentBlock(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.UNCOMMENTBLOCK:
            case VSConstants.VSStd2KCmdID.UNCOMMENT_BLOCK:
                ExecuteUncommentBlock(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.COMPLETEWORD:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteCommitUniqueCompletionItem(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.SHOWMEMBERLIST:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteInvokeCompletionList(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.PARAMINFO:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteParameterInfo(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.QUICKINFO:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecuteQuickInfo(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.PASTE:
                GCManager.UseLowLatencyModeForProcessingUserInput();
                ExecutePaste(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            case VSConstants.VSStd2KCmdID.OPENFILE:
                ExecuteOpenFile(subjectBuffer, contentType, executeNextCommandTarget);
                break;

            default:
                return(NextCommandTarget.Exec(ref pguidCmdGroup, commandId, executeInformation, pvaIn, pvaOut));
            }

            return(result);
        }