예제 #1
0
 public void StartDownload(Download download)
 {
     this._download = download;
     this.labelStatistics.Text = i18n.ConnectingDownloadServer;
     this._download.Progress += OnDownloadProgress;
     this._download.Complete += OnDownloadComplete;
     this._download.Start();
 }
예제 #2
0
 public void DownloadFileTest()
 {
     Download download=new Download(Uri,Filename);
     download.Complete += DownloadComplete;
     download.Start();
     this._waitHandler.WaitOne(); // wait until download complete event is handled.
     Assert.IsTrue(download.Success, string.Format("Failed downloading the test file: {0}.", Uri));
     string calculatedChecksum = CalculateFileSha1Checksum(Filename);
     Assert.IsTrue(ExpectedChecksum == calculatedChecksum, string.Format("Downloaded file's SHA1 checksum ({0}) is not equal to expected checksum ({1}).", ExpectedChecksum, calculatedChecksum));
 }
예제 #3
0
 // requests a regular download.
 public Download Add(string uri)
 {
     Download download = new Download(uri);
     this._downloads.Add(download);
     return download;
 }