示例#1
0
        protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
        {
            int returnCode;

            if (HierarchyHelpers.QueryStatusOnProjectSourceNode(this, cmdGroup, cmd, ref result, out returnCode))
            {
                return(returnCode);
            }

            return(base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result));
        }
示例#2
0
        /// <summary>
        /// Handles the menuitems
        /// </summary>
        protected override int QueryStatusOnNode(
            Guid guidCmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
        {
            int returnCode;

            if (HierarchyHelpers.QueryStatusOnProjectSourceNode(this, guidCmdGroup, cmd, ref result, out returnCode))
            {
                return(returnCode);
            }

            if (guidCmdGroup == VsMenus.guidStandardCommandSet97)
            {
                switch ((VsCommands)cmd)
                {
                case VsCommands.AddNewItem:
                case VsCommands.AddExistingItem:
                case VsCommands.ViewCode:
                    result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
                    return(VSConstants.S_OK);

                case VsCommands.ViewForm:
                    if (HasDesigner)
                    {
                        result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
                    }
                    return(VSConstants.S_OK);
                }
            }
            else if (guidCmdGroup == MenuCmd.guidNemerleProjectCmdSet)
            {
                if (cmd == (uint)MenuCmd.SetAsMain.ID)
                {
                    result |= QueryStatusResult.SUPPORTED | QueryStatusResult.ENABLED;
                    return(VSConstants.S_OK);
                }
            }

            return(base.QueryStatusOnNode(guidCmdGroup, cmd, pCmdText, ref result));
        }