private void OnWorkerProgressChanged(object sender, StreamCopyProgressEventArgs eventArgs) { if (isCancelled) { return; } if (TotalBytesToReceive == 0) { return; } var progress = eventArgs.BytesReceived / TotalBytesToReceive; var progressPercentage = (int)(progress * 100); OnDownloadProgressChanged(this, new DownloadFileProgressChangedArgs(progressPercentage, eventArgs.BytesReceived, TotalBytesToReceive)); }
private void OnProgressChanged(StreamCopyProgressEventArgs args) { ProgressChanged.SafeInvoke(this, args); }