Example #1
0
 /// <summary>
 /// Helper method to fire the event.
 /// </summary>
 /// <param name="e">The event information.</param>
 private void OnDownloadProgress(DownloadTaskProgressEventArgs e)
 {
     if (DownloadProgress != null)
     {
         DownloadProgress(this, e);
     }
 }
Example #2
0
        /// <summary>
        /// Method called by BITS when the job is modified, this method is used to notify progress.
        /// </summary>
        /// <param name="task">The DownloadTask instance.</param>
        /// <param name="pJob">The BITS job reference.</param>
        private void OnJobModification(DownloadTask task, IBackgroundCopyJob pJob)
        {
            BG_JOB_PROGRESS progress;

            pJob.GetProgress(out progress);

            var args = new DownloadTaskProgressEventArgs((long)progress.BytesTotal,
                                                         (long)progress.BytesTransferred, (int)progress.FilesTotal,
                                                         (int)progress.FilesTransferred, task);

            OnDownloadProgress(args);
        }