Exemple #1
0
        /// <summary>
        /// The method will be called by the OnStatusChanged method.
        /// </summary>
        /// <param name="e"></param>
        protected virtual void OnDownloadCompleted(DownloadCompletedEventArgs e)
        {
            if (e.Error != null && this.status != DownloadStatus.Canceled)
            {
                this.Status = DownloadStatus.Completed;
            }

            DownloadCompleted?.Invoke(this, e);
        }
 /// <summary>
 /// Handle the DownloadCompleted event of all the HttpDownloadClients.
 /// </summary>
 void client_DownloadCompleted(object sender, DownloadCompletedEventArgs e)
 {
     if (e.Error != null &&
         Status != DownloadStatus.Canceling &&
         Status != DownloadStatus.Canceled)
     {
         Cancel();
         OnDownloadCompleted(new DownloadCompletedEventArgs(
                                 null,
                                 DownloadedSize,
                                 TotalSize,
                                 TotalUsedTime,
                                 e.Error));
     }
 }
 /// <summary>
 /// Raise DownloadCompleted event.
 /// </summary>
 protected virtual void OnDownloadCompleted(
     DownloadCompletedEventArgs e)
 {
     DownloadCompleted?.Invoke(this, e);
 }