Encapsulates the information needed to provide download progress for the Write Object Event.
Inheritance: Amazon.S3.Model.TransferProgressArgs
        private void downloadedProgressEventCallback(object sender, WriteObjectProgressArgs e)
        {
            var transferredBytes = Interlocked.Add(ref _transferredBytes, e.IncrementTransferred);

            int numberOfFilesDownloaded = _numberOfFilesDownloaded;
            if (e.TransferredBytes == e.TotalBytes)
            {
                numberOfFilesDownloaded = Interlocked.Increment(ref _numberOfFilesDownloaded);
            }

            DownloadDirectoryProgressArgs downloadDirectoryProgress = null;
            if (_request.DownloadFilesConcurrently)
            {
                // If concurrent download is enabled, values for current file, 
                // transferred and total bytes for current file are not set.
                downloadDirectoryProgress = new DownloadDirectoryProgressArgs(numberOfFilesDownloaded, _totalNumberOfFilesToDownload,
                           transferredBytes, _totalBytes,
                           null, 0, 0);
            }
            else
            {
                downloadDirectoryProgress = new DownloadDirectoryProgressArgs(numberOfFilesDownloaded, _totalNumberOfFilesToDownload,
                    transferredBytes, _totalBytes,
                    _currentFile, e.TransferredBytes, e.TotalBytes);
            }
            _request.OnRaiseProgressEvent(downloadDirectoryProgress);
        }
 /// <summary>
 /// Causes the WriteObjectProgressEvent event to be fired.
 /// </summary>
 /// <param name="progressArgs">Progress data for the stream being written to file.</param>        
 internal void OnRaiseProgressEvent(WriteObjectProgressArgs progressArgs)
 {
     AWSSDKUtils.InvokeInBackground(WriteObjectProgressEvent, progressArgs, this);
 }
 void OnWriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     // Process progress update events.
 }
Esempio n. 4
0
 void OnWriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
     {
     this._request.OnRaiseProgressEvent(e);
 }
        private void downloadedProgressEventCallback(object sender, WriteObjectProgressArgs e)
        {
            int numberOfFilesDownloaded = this._numberOfFilesDownloaded;
            if (e.TransferredBytes == e.TotalBytes)
                numberOfFilesDownloaded++;

            this._request.OnRaiseProgressEvent(numberOfFilesDownloaded, this._totalNumberOfFilesToDownload,
                this._currentFile, e.TransferredBytes, e.TotalBytes);
        }
Esempio n. 6
0
 private void WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     if (this.LogProgress)
     {
         _Log.Verbose("{0} ({1}/{2})", this.GetPercent(e).ToString("N2") + "%", (e.TransferredBytes / 1000).ToString("N0"), (e.TotalBytes / 1000).ToString("N0"));
     }
 }
Esempio n. 7
0
        internal void DownloadProgressEvent(object sender, WriteObjectProgressArgs e)
        {
            var progressReport = new TaskProgressReport
            {
                Name = _name,
                PercentComplete = e.PercentDone,
                CurrentStep = e.TransferredBytes,
                TotalSteps = e.TotalBytes
            };

            _progress.Report(progressReport);
        }
Esempio n. 8
0
 void getResponse_WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e) {
     this.ReportProcess(e.PercentDone);
 }