示例#1
0
        int IOleCommandTarget.Exec(ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            // On every command, update the tip window if it's active.
            if (this.textTipData != null && this.textTipData.IsActive())
            {
                textTipData.CheckCaretPosition(this.textView);
            }

            int rc = ExecCommand(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut);

            if (rc < 0 && nextTarget != null)
            {
                try {
                    return(this.nextTarget.Exec(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut));
                } catch {
                    return(rc);
                }
            }
            return(rc);
        }
示例#2
0
        /// <include file='doc\ViewFilter.uex' path='docs/doc[@for="ViewFilter.IOleCommandTarget.Exec"]/*' />
        /// <internalonly/>
        int IOleCommandTarget.Exec(ref Guid guidCmdGroup, uint nCmdId, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
        {
            ushort lo = (ushort)(nCmdexecopt & (uint)0xffff);
            ushort hi = (ushort)(nCmdexecopt >> 16);

            switch (lo)
            {
            case (ushort)OLECMDEXECOPT.OLECMDEXECOPT_SHOWHELP:
                if ((nCmdexecopt >> 16) == VsMenus.VSCmdOptQueryParameterList)
                {
                    return(QueryParameterList(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut));
                }
                break;

            default:
                // On every command, update the tip window if it's active.
                if (this.textTipData != null && this.textTipData.IsActive())
                {
                    textTipData.CheckCaretPosition(this.textView);
                }

                int rc = ExecCommand(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut);

                if (rc < 0 && nextTarget != null)
                {
                    try {
                        return(this.nextTarget.Exec(ref guidCmdGroup, nCmdId, nCmdexecopt, pvaIn, pvaOut));

#if DEBUG
                    } catch (Exception ex) {
                        Trace.WriteLine("Unhandled exception in IOleCommandTarget.Exec: " + ex.Message);
#else
                    } catch (Exception) {
#endif
                        return(rc);
                    }
                }
                return(rc);
            }
            return((int)OleConstants.OLECMDERR_E_NOTSUPPORTED);
        }