private void uiContex2Cmd_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 && isProfilingBuildTime == 0 && !VsShellUtilities.IsSolutionBuilding(this) && ProjectHelper.IsCPPNode(projectItemId, hierarchy))
{
menuCommand.Visible = true;
menuCommand.Text = isProfilingInstantiations != 0 ? "Cancel Instantiation Profile..." : "Profile Template Instantiations";
return;
}
menuCommand.Visible = false;
}
}