Esempio n. 1
0
 private void downloader_DownloadProgressChanged(object sender, DownloadProgressEventArgs e)
 {
     if (DownloadProgressChanged != null)
     {
         DownloadProgressChanged(sender, e);
     }
 }
Esempio n. 2
0
 /// <summary>
 /// 触发下载进度事件
 /// </summary>
 /// <param name="e"></param>
 protected virtual void OnDownloadProgressChanged(DownloadProgressEventArgs e)
 {
     if (DownloadProgressChanged != null)
     {
         DownloadProgressChanged(this, e);
     }
 }
Esempio n. 3
0
 /// <summary>
 /// 异步下载进度事件(仅对于单个文件)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 void webClient_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
 {
     DownloadProgressEventArgs args = new DownloadProgressEventArgs(e.ProgressPercentage, e.UserState);
     args.BytesReceived = e.BytesReceived;
     args.FileName = e.UserState.ToString();
     args.TotalBytesToReceive = e.TotalBytesToReceive;
     if (current != null)
     {
         current.Post(onProgressReportDelegate, args);
     }
 }
Esempio n. 4
0
 void DownloadProgressChanged(object sender, DownloadProgressEventArgs e)
 {
     pgbApp.Value = e.ProgressPercentage;
     lab_percent.Text = e.ProgressPercentage.ToString() + "%";
     lab_percent.Update();
     lab_fileinfo.Text = string.Format("{0}KB/{1}KB", (e.BytesReceived / 1024).ToString("F2"), (e.TotalBytesToReceive / 1024).ToString("F2"));
     lab_fileinfo.Update();
     lab_filename.Text = "正在下载文件:" + e.FileName;
     lab_filename.Update();
 }