示例#1
0
        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));
        }
示例#2
0
 private void OnProgressChanged(StreamCopyProgressEventArgs args) => ProgressChanged.SafeInvoke(this, args);