Ejemplo n.º 1
0
        private void BeforeQueryStatus(object sender, EventArgs e)
        {
            var menuCommand = sender as OleMenuCommand;

            if (menuCommand == null)
            {
                return;
            }

            CommandsUtil.ShowAndEnableCommand(menuCommand, false);

            var proj = VisualStudioAutomationHelper.GetActiveProject(_dte);

            if (!VisualStudioAutomationHelper.IsANetCoreProject(proj) && (!CommandsUtil.IsWebApiCoreInstalled(proj) || IsWebApiExplorerInstalled()))
            {
                return;
            }

            if (VisualStudioAutomationHelper.IsANetCoreProject(proj) && (!CommandsUtil.IsAspNet5MvcInstalled(proj) || IsNetCoreApiExplorerInstalled()))
            {
                return;
            }

            CommandsUtil.ShowAndEnableCommand(menuCommand, true);
        }
        private void BeforeQueryStatus(object sender, EventArgs e)
        {
            var menuCommand = sender as OleMenuCommand;

            if (menuCommand == null)
            {
                return;
            }

            CommandsUtil.ShowAndEnableCommand(menuCommand, false);

            if (!IsMsTestsInstalled())
            {
                return;
            }

            CommandsUtil.ShowAndEnableCommand(menuCommand, true);
        }