public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            if (pguidCmdGroup == CommonConstants.Std2KCmdGroupGuid)
            {
                switch ((VSConstants.VSStd2KCmdID)nCmdID)
                {
                case VSConstants.VSStd2KCmdID.COMMENT_BLOCK:
                case VSConstants.VSStd2KCmdID.COMMENTBLOCK:
                    if (EditorExtensions.CommentOrUncommentBlock(_textView, comment: true))
                    {
                        return(VSConstants.S_OK);
                    }
                    break;

                case VSConstants.VSStd2KCmdID.UNCOMMENT_BLOCK:
                case VSConstants.VSStd2KCmdID.UNCOMMENTBLOCK:
                    if (EditorExtensions.CommentOrUncommentBlock(_textView, comment: false))
                    {
                        return(VSConstants.S_OK);
                    }
                    break;
                }
            }
            return(_next.Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut));
        }
Exemplo n.º 2
0
        public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            if (pguidCmdGroup == CommonConstants.Std2KCmdGroupGuid)
            {
                switch ((VSConstants.VSStd2KCmdID)nCmdID)
                {
                case VSConstants.VSStd2KCmdID.COMMENT_BLOCK:
                case VSConstants.VSStd2KCmdID.COMMENTBLOCK:
                    if (EditorExtensions.CommentOrUncommentBlock(_textView, comment: true))
                    {
                        return(VSConstants.S_OK);
                    }
                    break;

                case VSConstants.VSStd2KCmdID.UNCOMMENT_BLOCK:
                case VSConstants.VSStd2KCmdID.UNCOMMENTBLOCK:
                    if (EditorExtensions.CommentOrUncommentBlock(_textView, comment: false))
                    {
                        return(VSConstants.S_OK);
                    }
                    break;
                }
            }
            else if (pguidCmdGroup == VSConstants.GUID_VSStandardCommandSet97)
            {
                switch ((VSConstants.VSStd97CmdID)nCmdID)
                {
                case VSConstants.VSStd97CmdID.GotoDefn:
                    GoToDefinition();
                    return(VSConstants.S_OK);

                case VSConstants.VSStd97CmdID.F1Help:
                    GetHelp();
                    return(VSConstants.S_OK);
                }
            }

            return(_next.Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut));
        }