Browse Source

Get Proxy Server for Web Client asynchronously

This prevents WebRequest.GetSystemWebProxy() from blocking UI
pull/546/head
Linquize 10 years ago
parent
commit
3bf6f9b31f
  1. 2
      ILSpy/AboutPage.cs

2
ILSpy/AboutPage.cs

@ -179,6 +179,7 @@ namespace ICSharpCode.ILSpy @@ -179,6 +179,7 @@ namespace ICSharpCode.ILSpy
static Task<AvailableVersionInfo> GetLatestVersionAsync()
{
var tcs = new TaskCompletionSource<AvailableVersionInfo>();
new Action(() => {
WebClient wc = new WebClient();
IWebProxy systemWebProxy = WebRequest.GetSystemWebProxy();
systemWebProxy.Credentials = CredentialCache.DefaultCredentials;
@ -203,6 +204,7 @@ namespace ICSharpCode.ILSpy @@ -203,6 +204,7 @@ namespace ICSharpCode.ILSpy
}
};
wc.DownloadDataAsync(UpdateUrl);
}).BeginInvoke(null, null);
return tcs.Task;
}

Loading…
Cancel
Save