locked
Disable Remove Option on Virtual Project Node in VSIS app RRS feed

  • Question

  • VSIS app.

    I am not able to disable Remove Option on Virtual Project Node in VSIS app.  I have tried the IDelete interfaces, Node CanDelete and below code.  Nothing seems to work.

    It gets removed from the Node, however I can still see Remove option on Edit menu.

    Please let me know if you have any idea.

    protected override int QueryStatusOnNode(Guid cmdGroup, uint cmd, IntPtr pCmdText, ref QueryStatusResult result)
            {
                if (cmdGroup == VsMenus.guidStandardCommandSet97)
                {
                    switch ((VSConstants.VSStd97CmdID)cmd)
                    {
                        case VSConstants.VSStd97CmdID.Cut:
                        case VSConstants.VSStd97CmdID.Delete:
                        case VSConstants.VSStd97CmdID.Remove:
                        case VSConstants.VSStd97CmdID.Copy:
                            result = QueryStatusResult.SUPPORTED | QueryStatusResult.INVISIBLE;
                            return VSConstants.S_OK;
                        case VSConstants.VSStd97CmdID.Open:
                        case VSConstants.VSStd97CmdID.OpenProjectItem:
                            result = QueryStatusResult.ENABLED | QueryStatusResult.SUPPORTED;
                            return VSConstants.S_OK;      
                        default:
                            result = QueryStatusResult.SUPPORTED | QueryStatusResult.INVISIBLE;
                            return VSConstants.S_OK;    
                    }
                }
                return base.QueryStatusOnNode(cmdGroup, cmd, pCmdText, ref result);
            }

    Monday, November 18, 2013 5:08 PM