internal virtual int ExecCommandIndependentOfSelection()

in vsintegration/src/FSharp.ProjectSystem.Base/Project/HierarchyNode.cs [1509:1571]


        internal virtual int ExecCommandIndependentOfSelection(Guid cmdGroup, uint cmdId, uint cmdExecOpt, IntPtr vaIn, IntPtr vaOut, CommandOrigin commandOrigin, out bool handled)
        {
            handled = false;

            if (this.projectMgr == null || this.projectMgr.IsClosed)
            {
                return VSConstants.E_FAIL;
            }

            if (cmdGroup == VsMenus.guidStandardCommandSet97)
            {
                if (commandOrigin == CommandOrigin.OleCommandTarget)
                {
                    switch ((VsCommands)cmdId)
                    {
                        case VsCommands.Cut:
                        case VsCommands.Copy:
                        case VsCommands.Paste:
                        case VsCommands.Rename:
                            handled = true;
                            return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;
                    }
                }

                switch ((VsCommands)cmdId)
                {
                    case VsCommands.Copy:
                        handled = true;
                        return this.ProjectMgr.CopyToClipboard();

                    case VsCommands.Cut:
                        handled = true;
                        return this.ProjectMgr.CutToClipboard();

                    case VsCommands.SolutionCfg:
                        handled = true;
                        return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;

                    case VsCommands.SearchCombo:
                        handled = true;
                        return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;

                }
            }
            else if (cmdGroup == VsMenus.guidStandardCommandSet2K)
            {
                // There should only be the project node who handles these and should manifest in the same action regardles of selection.
                switch ((VsCommands2K)cmdId)
                {
                    case VsCommands2K.SHOWALLFILES:
                        handled = true;
                        return this.projectMgr.ShowAllFiles();
                    case VsCommands2K.ADDREFERENCE:
                        handled = true;
                        return this.projectMgr.AddProjectReference();
                    case VsCommands2K.ADDWEBREFERENCE:
                        handled = true;
                        return this.projectMgr.AddWebReference();
                }
            }

            return (int)OleConstants.OLECMDERR_E_NOTSUPPORTED;
        }