Пример #1
0
            public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
            {
                var commandId = new CommandID(pguidCmdGroup, (int)nCmdID);

                bool isSupported = _owner._commandTarget.HandlesCommand(commandId);

                if (!isSupported)
                {
                    if (_owner.NextCommandTarget == null)
                    {
                        return((int)Constants.OLECMDERR_E_NOTSUPPORTED);
                    }
                    else
                    {
                        return(OleCommandTargetSpy.WrapExec(_owner, _owner.NextCommandTarget, ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut));
                    }
                }

                try {
                    _owner._commandTarget.Execute(commandId);
                    return(VSConstants.S_OK);
                }
                catch (Exception e) {
                    Logger.LogError(e, "Error executing editor command.");
                    return(Marshal.GetHRForException(e));
                }
            }
Пример #2
0
 public int Exec(ref Guid pguidCmdGroup, uint nCmdID, uint nCmdexecopt, IntPtr pvaIn, IntPtr pvaOut)
 {
     return(OleCommandTargetSpy.WrapExec(this, _impl, ref pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut));
 }