Esempio n. 1
0
        /// <summary>
        /// This function is the callback used to execute the command when the menu item is clicked.
        /// See the constructor to see how the menu item is associated with this function using
        /// OleMenuCommandService service and MenuCommand class.
        /// </summary>
        /// <param name="sender">Event sender.</param>
        /// <param name="e">Event args.</param>
        protected override void MenuItemCallback(object sender, EventArgs e)
        {
            base.PreMenuItemCallback();

            m_solutionBrowser.CheckOutProjectVersionFiles(m_solutionBrowser.ProjectsToUpdate);
            SetupProjectsLoader spl = new SetupProjectsLoader(m_devEnvApplicationObject);

            spl.UnloadSetupProjects(m_solutionBrowser.ProjectsToUpdate);
            m_solutionBrowser.SaveVersions();
            spl.ReloadSetupProjects();

            bool runCommand = true;

            if (m_solutionBrowser.UpdateSummary.UpdatedItemsCount == 0)
            {
                runCommand = NoUpdateForm.Show(new WindowAdapter(m_devEnvApplicationObject.MainWindow.HWnd)) == DialogResult.Yes;
            }

            if (runCommand)
            {
                m_devEnvApplicationObject.ExecuteCommand("Build.RebuildSolution", "");
            }

            if (m_solutionBrowser.UpdateSummary.UpdatedItemsCount > 0 && ConfigurationPersister.Instance.Configuration.DisplayOptions.ShowSuccessDialog)
            {
                OperationSuccesForm.Show(new WindowAdapter(m_devEnvApplicationObject.MainWindow.HWnd), m_solutionBrowser.UpdateSummary.SummaryItems);
            }
        }
        public static DialogResult Show(IWin32Window owner, UpdateSummary.UpdateSummaryItem[] updatedSummary)
        {
            OperationSuccesForm osf = new OperationSuccesForm(updatedSummary);

            osf.StartPosition = FormStartPosition.CenterParent;
            return(osf.ShowDialog(owner));
        }