public void worker_OnProgressUpdate(object sender, ProgressEventArgs e) { //throttle progress updates so UI does not flicker var progress = Convert.ToInt32(100.0 * (Convert.ToDouble(e.TotalBytesDownloaded) / Convert.ToDouble(m_fileSize))); if (progress > ProgressValue) { ProgressValue = progress; } }
private void ProgressUpdate(int bytesReceived) { if (OnProgressUpdate == null) return; var args = new ProgressEventArgs(_downloaded, bytesReceived, _length); OnProgressUpdate(this, args); }