protected virtual void OnUpdateAppStatusChanged(OverallStatus obj) { UnityDispatcher.Invoke(() => { if (UpdateAppStatusChanged != null) { UpdateAppStatusChanged(obj); } }); }
private void UpdateOverallStatus() { var result = OverallStatus.GetOverallStatus(); _currentDT = (DateTime)result[0]; _filesMissing = (int)result[1]; _corruptFiles = (int)result[2]; ct.Text = _currentDT.ToString("h:mm tt"); cd.Text = _currentDT.ToString("M/d/yyyy"); }
private string GetDownloadSpeedFormated(OverallStatus status) { double kbPerSecond = status.DownloadBytesPerSecond / 1024.0; switch (_downloadSpeedUnit) { case "kilobytes": return(FormatDownloadSpeedKilobytes(kbPerSecond)); case "megabytes": return(FormatDownloadSpeedMegabytes(kbPerSecond)); default: // "human_readable" and any other { return(kbPerSecond > 1024.0 ? FormatDownloadSpeedMegabytes(kbPerSecond) : FormatDownloadSpeedKilobytes(kbPerSecond)); } } }
public void CreateSummaryReport(string rootDirectory) { //Console.WriteLine("Creating Test Suite Summary Report"); string fullyQulaifiedSummaryFileName = rootDirectory + Path.DirectorySeparatorChar + CoarseGrind.SUMMARY_FILE_NAME; DelimitedDataManager <string> summaryReport = null; try { summaryReport = DelimitedDataManager <string> .FromFile(fullyQulaifiedSummaryFileName, new StringParser()); } catch { summaryReport = new DelimitedDataManager <string>(columnNames: SUMMARY_HEADERS); } foreach (Test thisCase in this) { //if (thisCase.wasRun) summaryReport.addDataRow(thisCase.getSummaryDataRow()); if (thisCase.WasSetup) { summaryReport.addDataRow(thisCase.SummaryDataRow); } } summaryReport.ToFile(fullyQulaifiedSummaryFileName); string fullyQulaifiedSummaryTextFileName = rootDirectory + Path.DirectorySeparatorChar + CoarseGrind.SUMMARY_TEXTFILE_NAME; try { TextOutputManager textFile = new TextOutputManager(fullyQulaifiedSummaryTextFileName); textFile.WriteLine(OverallStatus.ToString()); textFile.Flush(); textFile.Close(); } catch { // DELIBERATE NO-OP } }
private float GetRemainingTime(OverallStatus status) { float remainingBytes = status.DownloadTotalBytes - status.DownloadBytes; return(remainingBytes / (float)status.DownloadBytesPerSecond); }
private ValidationStatus(OverallStatus disposition) { Disposition = disposition; Errors = new Dictionary <string, IList <string> >(); }
/// <summary>Generates a new failure status</summary> /// <param name="disposition">(Optional) The desired disposition of the new status (defaults to DataError)</param> /// <returns>The new status</returns> public static ValidationStatus Failure(OverallStatus disposition = OverallStatus.DataError) { return(new ValidationStatus(disposition)); }