void BgWorkerOnRunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (!e.Cancelled) { AutoUpdateXML update = (AutoUpdateXML)e.Result; if (update != null && update.IsNewerThan(this.applicationInfo.ApplicationAssembly.GetName().Version)) { if (new AutoUpdateAcceptForm(this.applicationInfo, update).ShowDialog(this.applicationInfo.Context) == DialogResult.Yes) { this.DownloadUpdate(update); } } } }
internal AutoUpdateAcceptForm(IAutoUpdatable applicationInfo, AutoUpdateXML updateInfo) { InitializeComponent(); this.applicationInfo = applicationInfo; this.updateInfo = updateInfo; this.Text = this.applicationInfo.ApplicationName + " - Update Available"; if (this.applicationInfo.ApplicationIcon != null) { this.Icon = this.applicationInfo.ApplicationIcon; } this.labelNewVersion.Text = $"New Version: {this.updateInfo.Version}"; }