protected virtual void OnUpdateProgress(UpdateProgressEventArgs e) { if (UpdateProgress != null) { UpdateProgress(this, e); } }
private void dlBeat_UpdateProgress(object sender, UpdateProgressEventArgs e) { if (InvokeRequired) { Invoke(new Downloader.UpdateProgressHandler(dlBeat_UpdateProgress), new object[] { sender, e }); return; } int percentProgress = Convert.ToInt32((e.DownloadSize * 100) / e.FileSize); lbDownloadSize.Text = Math.Round(e.DownloadSize / 1024 / 1024, 2) + " MB / " + Math.Round(e.FileSize / 1024 / 1024, 2) + " MB"; lbDownloadPercent.Text = percentProgress + "%"; prgDownload.Value = percentProgress; }