Meta.MetaPackage.uiContex3Cmd_BeforeQueryStatus C# (CSharp) Method

uiContex3Cmd_BeforeQueryStatus() private method

private uiContex3Cmd_BeforeQueryStatus ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void uiContex3Cmd_BeforeQueryStatus(object sender, EventArgs e)
        {
            OleMenuCommand menuCommand = sender as OleMenuCommand;
            if (menuCommand != null)
            {
                IntPtr hierarchyPtr, selectionContainerPtr;
                uint projectItemId;
                IVsMultiItemSelect mis;
                IVsMonitorSelection monitorSelection = (IVsMonitorSelection)Package.GetGlobalService(typeof(SVsShellMonitorSelection));
                monitorSelection.GetCurrentSelection(out hierarchyPtr, out projectItemId, out mis, out selectionContainerPtr);

                IVsHierarchy hierarchy = Marshal.GetTypedObjectForIUnknown(hierarchyPtr, typeof(IVsHierarchy)) as IVsHierarchy;
                if (hierarchy != null)
                {
                    if (ProjectHelper.IsCPPProject(projectItemId, hierarchy))
                    {
                        menuCommand.Visible = false;
                        menuCommand.Text = "Convert to x64";
                        return;
                    }
                }

                menuCommand.Visible = false;
            }
        }