Skip to content

Instantly share code, notes, and snippets.

@jmgomez
jmgomez / gist:6779191
Last active December 24, 2015 09:39
A simple download manager to download files via http. Feature to show percentage and resume downloads.
public interface IDownloadManager {
event DownloadManager.PercentageChangedDelegate OnPercentageChanged;
event DownloadManager.DownloadErrorDelegate OnDownloadError;
event DownloadManager.DownloadCompleteDelegate OnDownloadComplete;
Task DownloadFileAsync(string url, string localPath);
void AbortDownload();
bool IsTheSameFile(string expectedMD5, string filePath);
double Percentage { get; }
}
public class DownloadManager : IDownloadManager {