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