/// <summary> /// Событие DownloadCompleted для всех /// </summary> /// <param name="e"></param> /// <param name="sender"></param> void client_DownloadCompleted(object sender, DownloadCompletedEventArgs e) { if (e.Error != null && this.Status != StateDownload.Stopped) { this.Cancel(); this.OnDownloadCompleted(new DownloadCompletedEventArgs( null, this.DownloadedSize, this.TotalSize, this.TotalUsedTime,e.Error)); Server.SignalCompleting(this.HostName, this.id, this.Status, this.Url.AbsoluteUri, this.TotalSize, this.DownloadedSize,this.TotalUsedTime); } }
/// <summary> /// Если загрузка завершена успешно /// </summary> /// <param name="e"></param> protected virtual void OnDownloadCompleted(DownloadCompletedEventArgs e) { if (e.Error != null && this.status != StateDownload.Stopped) { this.Status = StateDownload.Completed; } if (DownloadCompleted != null) { DownloadCompleted(this, e); } }
/// <summary> /// Событие DownloadCompleted /// </summary> protected virtual void OnDownloadCompleted(DownloadCompletedEventArgs e) { if (DownloadCompleted != null) { DownloadCompleted(this, e); } }
void DownloadCompleted(object sender, DownloadCompletedEventArgs e) { if (sf.Count >= 1) SignalCompleting(sf[sf.Count - 1].HostName, sf[sf.Count - 1].id, sf[sf.Count-1].Status, sf[sf.Count - 1].Url.AbsoluteUri,sf[sf.Count - 1].TotalSize, e.DownloadedSize,e.TotalTime); }