Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ DownloadFileTaskAsync() [2/2]

Task System.Net.WebClient.DownloadFileTaskAsync ( Uri address,
string fileName )
inline

Definition at line 1978 of file WebClient.cs.

1979 {
1981 AsyncCompletedEventHandler handler = null;
1982 handler = delegate(object sender, AsyncCompletedEventArgs e)
1983 {
1984 HandleCompletion(tcs, e, (AsyncCompletedEventArgs args) => (object)null, handler, delegate(WebClient webClient, AsyncCompletedEventHandler completion)
1985 {
1986 webClient.DownloadFileCompleted -= completion;
1987 });
1988 };
1989 DownloadFileCompleted += handler;
1990 try
1991 {
1992 DownloadFileAsync(address, fileName, tcs);
1993 }
1994 catch
1995 {
1996 DownloadFileCompleted -= handler;
1997 throw;
1998 }
1999 return tcs.Task;
2000 }
AsyncCompletedEventHandler? DownloadFileCompleted
Definition WebClient.cs:257
void DownloadFileAsync(Uri address, string fileName)
delegate void AsyncCompletedEventHandler(object? sender, AsyncCompletedEventArgs e)

References System.ComponentModel.AsyncCompletedEventHandler(), System.Net.WebClient.DownloadFileAsync(), System.Net.WebClient.DownloadFileCompleted, and System.Threading.Tasks.TaskCompletionSource< TResult >.Task.