public bool TryGetProgressRecord(out ProgressRecord record) { record = null; lock (thisLock) { if (HasProgess()) { record = Progress(); return true; } } return false; }
public void ProgressUploadStatus(ProgressRecord record) { ProgressUploadStatus(record.PercentComplete, record.AvgThroughputMbPerSecond, record.RemainingTime); }
ProgressRecord Progress() { double computeAvg = ThrougputStats.ComputeAvg(ThroughputMBs()); double avtThroughputMbps = 8.0 * computeAvg; double remainingSeconds = (RemainingMB() / computeAvg); var pr = new ProgressRecord { PercentComplete = PercentComplete(), AvgThroughputMbPerSecond = avtThroughputMbps, RemainingTime = TimeSpan.FromSeconds(remainingSeconds) }; return pr; }