New answers tagged

1

Maybe something like this: public class Download { public EventHandler<int> Progress; public async Task GetData(string url) { int percentDone = 0; foreach (var chunk in chunks) { //get data //write data to disk? if(Progress != null) ...


4

The benefit of asynchronicity in any context is that the user does not have to wait for the method call to complete. This has benefits most specifically in UI's, where not blocking on a method call results in the UI appearing to be more responsive to the user. The answer to "should I switch to async?" is "will it improve the responsiveness of the ...



Top 50 recent answers are included