Пример #1
0
        /// <summary>
        /// Queries the status of a command handled by this package
        /// </summary>
        /// <param name="pguidCmdGroup">The guid of the Command.</param>
        /// <param name="cCmds">The number of commands.</param>
        /// <param name="prgCmds">The Commands to update.</param>
        /// <param name="pCmdText">Command text update pointer.</param>
        /// <returns></returns>
        public int QueryStatus(ref Guid pguidCmdGroup, uint cCmds, OLECMD[] prgCmds, IntPtr pCmdText)
        {
            if ((prgCmds == null))
            {
                return(VSErr.E_POINTER);
            }
            else if (GuidRefIsNull(ref pguidCmdGroup))
            {
                return(VSErr.OLECMDERR_E_NOTSUPPORTED);
            }

            Debug.Assert(cCmds == 1, "Multiple commands"); // Should never happen in VS

            if (Zombied || pguidCmdGroup != AnkhId.CommandSetGuid)
            {
                // Filter out commands that are not defined by this package
                return(VSErr.OLECMDERR_E_UNKNOWNGROUP);
            }

            int hr = CommandMapper.QueryStatus(Context, cCmds, prgCmds, pCmdText);

            return(hr);
        }