private void UpdateEngine_CheckForUpdatesCompleted(object sender, CheckForUpdatesCompletedEventArgs e) { if (InvokeRequired) { Invoke(new CheckForUpdatesCompletedEventHandler(UpdateEngine_CheckForUpdatesCompleted), sender, e); } else { Cursor = Cursors.Default; pbrCheckProgress.Visible = false; if (e.Error != null) { lblCheckMessage.Text = "Error: failed to connect to server. Please try again later."; } else if (e.Cancelled) { lblCheckMessage.Text = "Operation was cancelled."; } else { if (e.Result == null) { lblCheckMessage.Text = "Your software is up to date."; } else { // Switch to the downloads page and continue the process pnlContents.SelectedPage = pgDownloadUpdates; _vlist = e.Result; } // else } // else btnCancel.Text = "Close"; } // else }
private void CheckForUpdates_CheckForUpdatesCompleted(object sender, CheckForUpdatesCompletedEventArgs e) { Program.Invoke(this, delegate { refreshButton.Enabled = true; ShowProgress(false); checkForUpdatesSucceeded = e.Succeeded; if (checkForUpdatesSucceeded) { Rebuild(); } else { pictureBox.Image = SystemIcons.Error.ToBitmap(); UpdateLabels(false, e.ErrorMessage); UpdateDownloadAndInstallButton(false); } }); }