Beispiel #1
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"));
     }
 }
Beispiel #2
0
        private void DownloadFileProgressCallback(object sender, WriteObjectProgressArgs e)
        {
            var downloaded = e.TransferredBytes / Math.Pow(1024, 2);
            var total      = e.TotalBytes / Math.Pow(1024, 2);

            Console.Write("\r" + Math.Round(downloaded, 2) + "/" + Math.Round(total, 2) + " MB (" + e.PercentDone + "%)");
        }
Beispiel #3
0
 private void Response_WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     if (e.PercentDone % 10 == 0)
     {
         _logger.LogDebug(String.Format("{3} :: Transferred: {0}/{1} - Progress: {2}%", e.TransferredBytes, e.TotalBytes, e.PercentDone, e.Key));
     }
 }
Beispiel #4
0
        private void OnProcess(object sender, WriteObjectProgressArgs e)
        {
            var status = string.Format("{0} MB's / {1} MB's",
                                       (e.TransferredBytes / 1024d / 1024d).ToString("0.00"),
                                       (e.TotalBytes / 1024d / 1024d).ToString("0.00"));

            if (e.IsCompleted)
            {
                status = "Completed Download";
                Invoke((Action)(() =>
                {
                    ProcessDownload.Value = 100;
                    lbPercentDownload.Text = "100%";

                    groupSecurity.Enabled = true;
                    groupBucket.Enabled = true;
                    groupBucketDetail.Enabled = true;
                    btnChoose.Enabled = true;
                    btnStartDownload.Enabled = true;
                    btnPauseDownload.Enabled = false;
                    btnResumeDownload.Enabled = false;
                }));
            }
            Invoke((Action)(() =>
            {
                ProcessDownload.Value = e.PercentDone;
                lbPercentDownload.Text = e.PercentDone.ToString() + "%";
                lbStatusDownload.Text = status;
            }));
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
 public void UpdateProgress(string id, WriteObjectProgressArgs e)
 {
     if (_currentStream.Id != id)
     {
         return;
     }
     _progressText.text = e.PercentDone + "%" + "\t" + "Downloaded: " + SizeSuffix(e.TransferredBytes) + " / " +
                          SizeSuffix(e.TotalBytes);
 }
Beispiel #7
0
        private void Response_WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
        {
            var status = string.Format($"Tansfered: {e.TransferredBytes}/{e.TotalBytes} - Progress: {e.PercentDone}%");

            lblStatus.Invoke(new Action(() =>
            {
                lblStatus.Text = status;
            }));
        }
        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);
        }
Beispiel #9
0
 static void DownloadPartProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     _progressList[e.FilePath] = e.IsCompleted ? "Completed".PadRight(60) : $"{e.TransferredBytes:N}/{e.TotalBytes:N} bytes ({e.PercentDone.ToString()}% done)";
     if (Interlocked.Increment(ref _displayCount) % 2000 == 0 || e.IsCompleted)
     {
         foreach (var key in _progressList.Keys)
         {
             Console.WriteLine($"{key}: {_progressList[key]}");
             Thread.Sleep(TimeSpan.FromMilliseconds(200));
         }
         Console.WriteLine("");
     }
 }
        private void WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
        {
            var item = this._currentlyDownloadedPackages.FirstOrDefault(o => o.PackagePath == ((GetObjectResponse)sender).Key);

            if (item == null)
            {
                return;
            }

            item.TotalBytes       = e.TotalBytes;
            item.TransferredBytes = e.TransferredBytes;
            item.DownloadProgress = e.PercentDone;
        }
Beispiel #11
0
 private static void Response_WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     Debug.WriteLine($"Percent done: {e.PercentDone}%");
 }
Beispiel #12
0
 private static void Response_WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     Console.WriteLine($"Tansfered: {e.TransferredBytes}/{e.TotalBytes} - Progress: {e.PercentDone}%");
 }
Beispiel #13
0
 /// <summary>
 /// Downloading progression state reported by S3 SDK
 /// </summary>
 private void ResponseWriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     Console.ForegroundColor = ConsoleColor.Gray;
     Console.CursorLeft      = 0;
     Helpers.WriteProgress(e.PercentDone);
 }
Beispiel #14
0
 void OnWriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     this._request.OnRaiseProgressEvent(e);
 }
Beispiel #15
0
 /// <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);
 }
 private void WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     this._currentlyDownloadedPackages.Single(o => o.PackagePath == ((GetObjectResponse)sender).Key).DownloadProgress = e.PercentDone;
 }
Beispiel #17
0
 void Request_WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     // show progress
     System.Diagnostics.Debug.WriteLine("=======UpdateFileProgress=======");
 }
Beispiel #18
0
 void getResponse_WriteObjectProgressEvent(object sender, WriteObjectProgressArgs e)
 {
     this.ReportProcess(e.PercentDone);
 }