public void Resume()
{
// Only paused downloader can be paused.
if (this.Status != DownloadStatus.Paused)
{
throw new ApplicationException(
"Only paused downloader can be resumed. ");
}
// Set the lastStartTime to calculate the used time.
lastStartTime = DateTime.Now;
// Set the downloading status.
this.Status = DownloadStatus.Waiting;
// Resume all HttpDownloadClients.
foreach (var client in this.downloadClients)
{
if (client.Status != DownloadStatus.Completed)
{
client.Resume();
}
}
}