private void update_Click(object sender, EventArgs e) { Dispatcher.Schedule(300, () => { using (var dialog = new UpdateOptionsPanel(Distro.FromFixedLocation(customUpdateUrl.Text))) dialog.ShowModal(); }); Close(); }
void update_Click(object sender, EventArgs e) { Close(); Task.Run(() => { Thread.Sleep(300); var distro = Distro.FromFixedLocation(customUpdateUrl.Text); using (var dialog = new UpdateOptionsPanel(distro)) { dialog.ShowModal(); } }); }
void CheckForUpdates() { Distro distro = CSScriptHelper.GetLatestAvailableVersion(); Invoke((Action) delegate { SetUpdateStatus(); Cursor = Cursors.Default; }); if (distro == null) { MessageBox.Show("Cannot check for updates. The latest release Web page will be opened instead.", "CS-Script"); try { Process.Start(Plugin.HomeUrl); } catch { } } else { var latestVersion = new Version(distro.Version); var nppVersion = Assembly.GetExecutingAssembly().GetName().Version; if (nppVersion == latestVersion) { MessageBox.Show("You are already running the latest version - v" + distro.Version, "CS-Script"); } else if (nppVersion > latestVersion) { MessageBox.Show("Wow... your version is even newer than the latest one - v" + distro.Version + ".", "CS-Script"); } else if (nppVersion < latestVersion) { PostCloseAction = //Task.Factory.StartNew( () => { using (var dialog = new UpdateOptionsPanel(distro)) dialog.ShowModal(); }; //); Invoke((Action) delegate { Close(); }); } } }
static void CheckForUpdates() { Thread.Sleep(2000); //let Notepad++ to complete all initialization Distro distro = CSScriptHelper.GetLatestAvailableVersion(); if (distro != null && distro.Version != Config.Instance.SkipUpdateVersion) { var latestVersion = new Version(distro.Version); var nppVersion = Assembly.GetExecutingAssembly().GetName().Version; if (nppVersion < latestVersion) { using (var dialog = new UpdateOptionsPanel(distro)) dialog.ShowModal(); } } }