public LogSummary GetSummary() { if (Summary == null) { Summary = CreateSummary(); } return(Summary); }
public System.Windows.Controls.UserControl RenderLogWindow(IDatabaseInterface databaseInterface) { LogWindow logWindow = new LogWindow(); LogSummary logSummary = Logger.LoadLogSummary(databaseInterface); logWindow.LogSummaryControl.SetModel(logSummary); Logger logger = new Logger(databaseInterface); ObservableCollection <RecordLog> recordLogs = logger.ReadPagedRecords(1); logWindow.RecordLogListControl.SetModel(recordLogs); return(logWindow); }
protected LogSummary CreateSummary() { LogSummary NewSummary = new LogSummary(); NewSummary.BuildInfo = GetBuildInfo(); NewSummary.PlatformInfo = GetPlatformInfo(); NewSummary.Warnings = GetWarnings(); NewSummary.Errors = GetErrors(); NewSummary.FatalError = GetFatalError(); NewSummary.Ensures = GetEnsures(); NewSummary.LineCount = Content.Split('\n').Count(); NewSummary.RequestedExit = HasRequestExit(); NewSummary.HasTestExitCode = GetTestExitCode(out NewSummary.TestExitCode); return(NewSummary); }
public static LogSummary LoadLogSummary(IDatabaseInterface databaseInterface) { LogSummary logSummary = new LogSummary(); object result = null; result = databaseInterface.ExecuteScalar("Select count(*) from tblRecordLog"); logSummary.NumberOfRecordsLoaded = result == null ? -1 : Convert.ToInt32(result); result = databaseInterface.ExecuteScalar("Select count(*) from tblRecordLog where DeletionFault IS NULL"); logSummary.NumberOfSuccessfulRecords = result == null ? -1 : Convert.ToInt32(result); result = databaseInterface.ExecuteScalar("Select count(*) from tblRecordLog where DeletionFault IS NOT NULL"); logSummary.NumberOfFailedRecords = result == null ? -1 : Convert.ToInt32(result); return(logSummary); }
void RefreshLogs() { var tempLogSummary = new List <LogSummary>(); var files = Directory.GetFiles(App.Current.LogsDirectory, "*.bin"); foreach (var file in files) { var logSummary = new LogSummary() { Filename = file, Created = File.GetCreationTime(file), }; tempLogSummary.Add(logSummary); } _logsList.ReplaceRange(tempLogSummary); }