public AzStorage(TransferEngine engine, string connString, bool rethrowExceptions = false) { this.Engine = engine; this.ConnectionString = connString; this.RethrowExceptions = rethrowExceptions; GetStorageAccount(); if (this.StorageAccount != null) { this.Initialised = true; } }
public void Report(TransferStatus progress) { this.latestBytesTransferred = progress.BytesTransferred; this.latestNumberOfFilesTransferred = progress.NumberOfFilesTransferred; this.latestNumberOfFilesSkipped = progress.NumberOfFilesSkipped; this.latestNumberOfFilesFailed = progress.NumberOfFilesFailed; TimeSpan elapsed = DateTime.Now - lastTime; if (latestBytesTransferred == 0 && latestNumberOfFilesFailed == 0 && latestNumberOfFilesSkipped == 0 && latestNumberOfFilesTransferred == 0) { return; } else if ((latestBytesTransferred >= mark * markPosition) && (latestBytesTransferred >= (mark + 1) * markPosition)) { ++mark; Tuple <double, string> b = TransferEngine.PrintBytesToTuple(latestBytesTransferred / elapsed.TotalSeconds, "/s"); L.Info("Transferred {0} bytes for 1 file. Transfer rate: {1} {2}", latestBytesTransferred, b.Item1, b.Item2); } else if (latestNumberOfFilesTransferred == 1) { L.Info("{0} file transfer(s) completed, {1} skipped, {2} failed.", latestNumberOfFilesTransferred, latestNumberOfFilesSkipped, latestNumberOfFilesFailed); } }