GetAbsoluteUrl() public method

Converts an relative url to an absolute url based on the
public GetAbsoluteUrl ( string url ) : Uri
url string relative or absolute url
return System.Uri
 private async Task <string> DownloadReleaseNotes(string link, CancellationToken cancellationToken)
 {
     try
     {
         using (var webClient = new WebClient())
         {
             webClient.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
             webClient.Encoding          = Encoding.UTF8;
             if (cancellationToken != null)
             {
                 using (cancellationToken.Register(() => webClient.CancelAsync()))
                 {
                     return(await webClient.DownloadStringTaskAsync(_sparkle.GetAbsoluteUrl(link)));
                 }
             }
             return(await webClient.DownloadStringTaskAsync(_sparkle.GetAbsoluteUrl(link)));
         }
     }
     catch (WebException ex)
     {
         _sparkle.LogWriter.PrintMessage("Cannot download release notes from {0} because {1}", link, ex.Message);
         return("");
     }
 }
Exemplo n.º 2
0
        private string DownloadReleaseNotes(string link)
        {
            try
            {
                using (var webClient = new WebClient())
                {
                    webClient.Proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
                    webClient.Encoding          = Encoding.UTF8;

                    return(webClient.DownloadString(_sparkle.GetAbsoluteUrl(link)));
                }
            }
            catch (WebException ex)
            {
                Debug.WriteLine("Cannot download release notes from " + link + " because " + ex.Message);
                return("");
            }
        }