Well, I created a downloader that checks all files in a list and then it downloads all files.
Example:
Node Class:
public class Node
{
public string fileName { get; set; }
public string fileHash { get; set; }
public int fileSize { get; set; }
public Node(string fName, string fHash, int fSize)
{
fileName = fName;
fileHash = fHash;
fileSize = fSize;
}
}
public class Nodes : List<Node>
{
public void Fill(string name, string hash, int size)
{
Add(new Node(name, hash, size));
}
}
itemsUpdate:
List<Node> itemsUpdate = new List<Node>();
Downloading the files:
FileDownload fDownload;
foreach (Node n in itemsUpdate)
{
//fDownload contains all for the async download.
fDownload.Download(url, n.fileName);
//Here I show the current progress
while (fDownload.Progress != 100)
{
lblProgress.Text = fDownload.Progress.ToString() + "%";
}
lblProgress.Text = "100%";
}
What I want to know is how to calculate the total progress of the download. Hope someone could help me. Thanks