Microsoft.VisualStudio.Project.DependentFileNode.QueryStatusOnNode C# (CSharp) Method

QueryStatusOnNode() protected method

Disable certain commands for dependent file nodes
protected QueryStatusOnNode ( System.Guid cmdGroup, uint cmd, IntPtr pCmdText, EnvDTE.vsCommandStatus &result ) : int
cmdGroup System.Guid
cmd uint
pCmdText System.IntPtr
result EnvDTE.vsCommandStatus
return int
        protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref vsCommandStatus result)
        {
            if(cmdGroup == VsMenus.guidStandardCommandSet97)
            {
                switch((VsCommands)cmd)
                {
                    case VsCommands.Copy:
                    case VsCommands.Paste:
                    case VsCommands.Cut:
                    case VsCommands.Rename:
                        result = vsCommandStatus.vsCommandStatusUnsupported;
                        return VSConstants.S_OK;

                    case VsCommands.ViewCode:
                    case VsCommands.Open:
                    case VsCommands.OpenWith:
                        result |= vsCommandStatus.vsCommandStatusSupported | vsCommandStatus.vsCommandStatusEnabled;
                        return VSConstants.S_OK;
                }
            }
            else if(cmdGroup == VsMenus.guidStandardCommandSet2K)
            {
                if((VsCommands2K)cmd == VsCommands2K.EXCLUDEFROMPROJECT)
                {
                    result = vsCommandStatus.vsCommandStatusUnsupported;
                    return VSConstants.S_OK;
                }
            }
            else
            {
                return (int)OleConstants.OLECMDERR_E_UNKNOWNGROUP;
            }
            return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
        }