protected virtual void HttpDownloadFileCompleted(object sender, FileDownloadCompletedEventArgs e) { this._error = e.Error; this._cancelled = e.Cancelled; if (e.Error != null) { Console.WriteLine ("Error: " + e.Error.ToString ()); } else if (e.Cancelled) { Console.WriteLine ("Download cancelled"); } else { } }
protected virtual void OnDownloadCompleted(FileDownloadCompletedEventArgs e) { if (this.SynchronizingObject != null && this.SynchronizingObject.InvokeRequired) { //Marshal the call to the thread that owns the synchronizing object. this.SynchronizingObject.Invoke(new DownloadCompletedEventInvoker(OnDownloadCompleted), new object[] { e }); } else { if (DownloadCompleted != null) { DownloadCompleted(this, e); } } }
protected override void HttpDownloadFileCompleted(object sender, FileDownloadCompletedEventArgs e) { base.HttpDownloadFileCompleted (sender, e); this.RaiseCompleted (); }
protected override void HttpDownloadFileCompleted(object sender, FileDownloadCompletedEventArgs e) { base.HttpDownloadFileCompleted (sender, e); // see if we have more files to download... int nextUrlIndex = this._currentUrlIndex + 1; if (nextUrlIndex >= this._urls.Length || e.Cancelled || e.Error != null) { this.RaiseCompleted (); } else { this._currentUrlIndex = nextUrlIndex; this.DownloadNextFile (); } }