Onova.ReleaseNotes/ReleaseNotesExtensions.cs
/// <summary>
/// Downloads the release notes (.rn) for the given version.
/// Can only be used with <see cref="Onova.Services.WebPackageResolver"/>.
/// </summary>
Downloads the release notes (.rn) for the given version.
Can only be used with .
Downloads the release notes ( . rn ) for the given version . Can only be used with .
public static async Task<string> GetReleaseNotes(this UpdateManager mgr, Version version, CancellationToken cancellationToken = default)
        {
            var resolver = mgr.GetFieldValue<IPackageResolver>("_resolver");
            if (!(resolver is WebPackageResolver webPackageResolver))
                throw new NotImplementedException("Release notes are available only for WebPackageResolver.");
            var httpClient = webPackageResolver.GetFieldValue<HttpClient>("_httpClient");
            var x = await webPackageResolver.InvokeMethod<Task<IReadOnlyDictionary<Version, string>>>("GetPackageVersionUrlMapAsync", cancellationToken);
            var targetUrl = x[version];
            var extensionPos = targetUrl.LastIndexOf('.');
            targetUrl = targetUrl.Substring(0, extensionPos) + ".rn";
            var releaseNotes = await httpClient.GetStringAsync(targetUrl, cancellationToken);
            return releaseNotes;
        }
public static async Task < string > GetReleaseNotes ( this UpdateManager mgr , Version version , CancellationToken cancellationToken = default ) { var resolver = mgr . GetFieldValue < IPackageResolver > ( " " ) ; if ( ! ( resolver is WebPackageResolver webPackageResolver ) ) throw new NotImplementedException ( " " ) ; var httpClient = webPackageResolver . GetFieldValue < HttpClient > ( " " ) ; var x = await webPackageResolver . InvokeMethod < Task < IReadOnlyDictionary < Version , string > > > ( " " , cancellationToken ) ; var targetUrl = x [ version ] ; var extensionPos = targetUrl . LastIndexOf ( ' ' ) ; targetUrl = targetUrl . Substring ( 0 , extensionPos ) + " " ; var releaseNotes = await httpClient . GetStringAsync ( targetUrl , cancellationToken ) ; return releaseNotes ; }
Downloads the release notes (.rn) for the given version.
Downloads the release notes ( . rn ) for the given version .
UpdateManager
this
version
Version
cancellationToken
CancellationToken