/// <summary> /// Display infos about the file download /// </summary> /// <param name="e"></param> private void SetDownloadInfos(DownloadEventArgs e) { tspbImageDownload.Maximum = e.TotalCount; tspbImageDownload.Minimum = 0; tspbImageDownload.Value = e.Count; if (e.Count >= e.TotalCount) { tspbImageDownload.Value = 0; //downloadthread.Stop(); } if(!string.IsNullOrEmpty(e.Message)) tsslMessage.Text = e.Message; }
/// <summary> /// Notifyer from downloadthread /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void downloadthread_DownloadNotify(object sender, DownloadEventArgs e) { if (tvaFiles.InvokeRequired) { tvaFiles.Invoke(new MethodInvoker( delegate() { SetDownloadInfos(e); })); } else { SetDownloadInfos(e); } }