private void ChangeStateToShowNewVersion(VersionCheckingResult versionCheckingResult) { ProgressBarVisible = Visibility.Collapsed; AppVersionInfo versionInformation = versionCheckingResult.RetrievedAppVersionInfo; StatusText = string.Format(VersionCheckerResources.VersionCheckerWindow_StatusText_NewVersionAvailable, versionInformation.InformationalVersion); InformationText = versionInformation.DownloadUrl != null ? string.Format(VersionCheckerResources.VersionCheckerWindow_VersionDescription, versionInformation.Description) : string.Format(VersionCheckerResources.VersionCheckerWindow_VersionDescriptionNoDownload, versionInformation.Description, AppWebPage); DownloadButtonVisible = versionInformation.DownloadUrl != null ? Visibility.Visible : Visibility.Collapsed; CheckAgainButtonEnabled = true; }
/// <summary> /// Initializes a new instance of the <see cref="CheckCompletedEventArgs"/> class. /// </summary> /// <param name="error">The exception thrown by the version checker.</param> public CheckCompletedEventArgs(Exception error) : base(error, false, null) { versionCheckingResult = null; }
private void RetrieveNewCheckingResult() { LastCheckingResult = null; using (Stream stream = AppInfoProvider.GetStream(AppInfoFileLocation)) { AppVersionInfo newestVersion = AppInfoFileParser.GetAppInfo(stream, AppName); int comparationResult = newestVersion.Version.CompareTo(CurrentVersion); LastCheckingResult = new VersionCheckingResult { CurrentVersion = CurrentVersion, RetrievedAppVersionInfo = newestVersion, ComparationResult = comparationResult }; } }
/// <summary> /// Initializes a new instance of the <see cref="CheckCompletedEventArgs"/> class. /// </summary> /// <param name="versionCheckingResult">The results of the version checking operation.</param> public CheckCompletedEventArgs(VersionCheckingResult versionCheckingResult) : base(null, false, null) { this.versionCheckingResult = versionCheckingResult; }