void GitHub_NewVersion(Version current, Version latest, string name, string url) { if (InvokeRequired) { Invoke(new GitHub.NewVersionDlg(GitHub_NewVersion), current, latest, name, url); } else { NewVersionForm.CreateAndShowDialog(current, latest, name, url, this); } }
internal static void CreateAndShowDialog(Version current, Version latest, string name, string url, Form parent) { using (NewVersionForm f = new NewVersionForm(url)) { f.LblCurrentVersion.Text = current.ToString(3); f.LblLatestVersion.Text = latest.ToString(3); DialogResult rv = f.ShowDialog(parent); if (rv == DialogResult.OK) { System.Windows.Forms.Application.Exit(); //exit (spawned process will apply update) } else if (rv == DialogResult.Abort) { System.Windows.Forms.MessageBox.Show(Strings.BoxAutoUpdateFailed, Strings.BoxAutoUpdateResult, MessageBoxButtons.OK, MessageBoxIcon.Error); } } }