コード例 #1
0
ファイル: UpdateMessageBox.cs プロジェクト: andre-d/ShareXYZ
        public static void Start(UpdateChecker updateChecker, bool activateWindow = true)
        {
            if (updateChecker != null && updateChecker.Status == UpdateStatus.UpdateAvailable)
            {
                IsOpen = true;

                try
                {
                    DialogResult result;

                    using (UpdateMessageBox messageBox = new UpdateMessageBox())
                    {
                        messageBox.ActivateWindow = activateWindow;
                        result = messageBox.ShowDialog();
                    }

                    if (result == DialogResult.Yes)
                    {
                        using (DownloaderForm updaterForm = new DownloaderForm(updateChecker))
                        {
                            updaterForm.ShowDialog();

                            if (updaterForm.Status == DownloaderFormStatus.InstallStarted)
                            {
                                Application.Exit();
                            }
                        }
                    }
                }
                finally
                {
                    IsOpen = false;
                }
            }
        }
コード例 #2
0
ファイル: UpdateMessageBox.cs プロジェクト: andre-d/ShareXYZ
        public static void Start(UpdateChecker updateChecker, bool activateWindow = true)
        {
            if (updateChecker != null && updateChecker.Status == UpdateStatus.UpdateAvailable)
            {
                IsOpen = true;

                try
                {
                    DialogResult result;

                    using (UpdateMessageBox messageBox = new UpdateMessageBox())
                    {
                        messageBox.ActivateWindow = activateWindow;
                        result = messageBox.ShowDialog();
                    }

                    if (result == DialogResult.Yes)
                    {
                        using (DownloaderForm updaterForm = new DownloaderForm(updateChecker))
                        {
                            updaterForm.ShowDialog();

                            if (updaterForm.Status == DownloaderFormStatus.InstallStarted)
                            {
                                Application.Exit();
                            }
                        }
                    }
                }
                finally
                {
                    IsOpen = false;
                }
            }
        }