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