private void OnWorkerProgressChanged(object sender, StreamCopyProgressEventArgs eventArgs) { if (this.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); }