public override void OnMenuItemOpen()
 {
     // In current code, _attachDebuggerCommand won't be null
     // To be safe and in case the constructor/initiailzation code could be modified in the future.
     if (_attachDebuggerCommand != null)
     {
         _attachDebuggerCommand.CanExecuteCommand =
             Instance.IsWindowsInstance() && Instance.IsRunning() && !ShellUtils.IsBusy();
     }
     base.OnMenuItemOpen();
 }
        private void OnBeforeQueryStatus(object sender, EventArgs e)
        {
            var menuCommand = sender as OleMenuCommand;

            if (menuCommand == null)
            {
                return;
            }

            var selectedProject = SolutionHelper.CurrentSolution.SelectedProject;

            if (selectedProject == null || !PublishDialogWindow.CanPublish(selectedProject))
            {
                menuCommand.Visible = false;
            }
            else
            {
                menuCommand.Visible = true;
                menuCommand.Enabled = !ShellUtils.IsBusy();
            }
        }
예제 #3
0
        private void OnBeforeQueryStatus(object sender, EventArgs e)
        {
            var menuCommand = sender as OleMenuCommand;

            if (menuCommand == null)
            {
                return;
            }

            // Ensure that the menu entry is only available for ASP.NET Core projects.
            var selectedProject = SolutionHelper.CurrentSolution.SelectedProject;

            if (selectedProject == null || selectedProject.ProjectType != KnownProjectTypes.NetCoreWebApplication1_0)
            {
                menuCommand.Visible = false;
            }
            else
            {
                menuCommand.Visible = true;
                menuCommand.Enabled = !ShellUtils.IsBusy();
            }
        }
예제 #4
0
        private void OnBeforeQueryStatus(object sender, EventArgs e)
        {
            var menuCommand = sender as OleMenuCommand;

            if (menuCommand == null)
            {
                return;
            }

            menuCommand.Visible = true;

            var startupProject = SolutionHelper.CurrentSolution.StartupProject;

            if (startupProject == null)
            {
                menuCommand.Enabled = false;
                menuCommand.Text    = Resources.PublishDialogGenericMenuHeader;
            }
            else
            {
                menuCommand.Enabled = PublishDialogWindow.CanPublish(startupProject) && !ShellUtils.IsBusy();
                menuCommand.Text    = String.Format(Resources.PublishDialogProjectMenuHeader, startupProject.Name);
            }
        }