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