Exemplo n.º 1
0
        public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            if (pguidCmdGroup == VSConstants.VSStd2K)
            {
                if (nCmdID == (uint)VSConstants.VSStd2KCmdID.COMMENT_BLOCK)
                {
                    _view.CommentSelection();
                    return(VSConstants.S_OK);
                }

                if (nCmdID == (uint)VSConstants.VSStd2KCmdID.UNCOMMENT_BLOCK)
                {
                    _view.UncommentSelection();
                    return(VSConstants.S_OK);
                }
            }

            int hResult = Next.Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);

            if (!ErrorHandler.Succeeded(hResult))
            {
                return(hResult);
            }

            if (pguidCmdGroup != VSConstants.VSStd2K || (VSConstants.VSStd2KCmdID)nCmdID != VSConstants.VSStd2KCmdID.TYPECHAR)
            {
                return(hResult);
            }

            if (GetTypeChar(pvaIn).Equals('|'))
            {
                _view.AlignTable();
            }

            return(hResult);
        }