I did see all of your comments on my answer to your previous question, unfortunately, system is down to support comments etc.
A most simple method, if you just need to control when all of the background tasks finish, you can use
Task.WhenAll()
or
Task.WaitAll()
(
you cannot await void), you can await these calls for asynchronous approach.
var downloads = new List<Task>();
downloads.Add(Task.Run(() => {
}));
Then awaiting them all will be like,
Task.WhenAll(downloads.ToArray());
To check the progress, you might want to run the logic to see how much file has been downloaded, what the speed is etc. That is a bit
algorithmic.
IProgress[
^] interface can be used to configure the progress, but only if you need.
For even in-depth overview, read
Task Class (System.Threading.Tasks)[
^].
Task-based Asynchronous Pattern (TAP)[
^]
Task.WhenAll Method (Task[]) (System.Threading.Tasks)[
^]
Just a 1000ft overview is here,
c# - Check progress of download operation which started in background task - Stack Overflow[
^]
For more control over this, you will need to use
Thread
(which are not as much handier as
Task
), but gives more control.