/// <summary> /// Called when an update failed to download. /// </summary> /// <param name="error">The error message.</param> public void UpdateIOError(string error) { update.Tag = error; updateToolTipText.Text = "There was an error while downloading the update:\r\n" + error + "\r\nClick here to update manually!"; if (IsVisible && Top != -999) { var td = new VistaControls.TaskDialog.TaskDialog { CommonIcon = TaskDialogIcon.SecurityWarning, UseCommandLinks = true, Title = Signature.Software, Instruction = "Update error", Content = "There was an error while downloading the latest update for the software.", ExpandedInformation = error, ExpandedControlText = "Show error", CustomButtons = new[] { new CustomButton(Result.Yes, "Update manually"), new CustomButton(Result.No, "Postpone") } }; if (td.Show().CommonButton == Result.Yes) { Process.Start("http://lab.rolisoft.net/tvshowtracker/downloads.html"); } } else if (!IsVisible || Top == -999) { _askErrorUpdate = true; } }
/// <summary> /// Called when an update was downloaded. /// </summary> /// <param name="version">The new version.</param> /// <param name="ask">if set to <c>true</c> a TaskDialog will be displayed asking the user to update.</param> public void UpdateDownloaded(string version, bool ask) { update.Tag = version; updateOuter.Visibility = Visibility.Visible; updateToolTipTitle.Text = "v" + version + " is available"; updateToolTipText.Text = "Click here to install update!"; if (ask && IsVisible && Top != -999) { var td = new VistaControls.TaskDialog.TaskDialog { CommonIcon = TaskDialogIcon.SecurityWarning, UseCommandLinks = true, Title = Signature.Software, Instruction = "Update available", Content = "Version " + version + " has been downloaded and is ready to be installed!", CustomButtons = new[] { new CustomButton(Result.Yes, "Install now"), new CustomButton(Result.No, "Postpone") } }; if (td.Show().CommonButton == Result.Yes) { UpdateMouseLeftButtonUp(); } } else if (ask && (!IsVisible || Top == -999)) { _askUpdate = true; } }