private void ProcessDownloadStatus(DownloadStatusHolder downloadStatusHolder)
        {
            _overallStatus.IsDownloading          = downloadStatusHolder.IsDownloading;
            _overallStatus.DownloadBytesPerSecond = downloadStatusHolder.BytesPerSecond;
            _overallStatus.DownloadBytes          = downloadStatusHolder.Bytes;
            _overallStatus.DownloadTotalBytes     = downloadStatusHolder.TotalBytes;

            _overallStatus.Progress = CalculateOverallProgress();

            OnStatusChanged();
        }
        public IDownloadStatusReporter CreateDownloadStatusReporter(double weight)
        {
            var status = new DownloadStatusHolder(weight);

            _statusHolders.Add(status);

            var reporter = new DownloadStatusReporter(status);

            reporter.StatusReported += ProcessDownloadStatus;

            return(reporter);
        }
Beispiel #3
0
        public DownloadStatusReporter(DownloadStatusHolder downloadStatusHolder)
        {
            Checks.ArgumentNotNull(downloadStatusHolder, "downloadStatusHolder");

            _downloadStatusHolder = downloadStatusHolder;
        }