// Format an instance of GenerateProgramResultsResults for UI presentation // // Uses the CurrentCulture void BuildGenerateProgramResults(StringBuilder mesg, IGGenerateProgramResult gGenerateProgramResult, Stopwatch?stopwatch) { mesg.Clear(); if (stopwatch != null) { mesg.Append(uiLocalizer["Running the function took {0} milliseconds", stopwatch.ElapsedMilliseconds.ToString(CultureInfo.CurrentCulture)]); mesg.Append(Environment.NewLine); } mesg.Append(uiLocalizer["DB extraction was successful: {0}", gGenerateProgramResult.DBExtractionSuccess.ToString(CultureInfo.CurrentCulture)]); mesg.Append(Environment.NewLine); mesg.Append(uiLocalizer["Build was successful: {0}", gGenerateProgramResult.BuildSuccess.ToString(CultureInfo.CurrentCulture)]); mesg.Append(Environment.NewLine); mesg.Append(uiLocalizer["Unit Tests were successful: {0}", gGenerateProgramResult.UnitTestsSuccess.ToString(CultureInfo.CurrentCulture)]); mesg.Append(Environment.NewLine); mesg.Append(uiLocalizer["Unit Tests coverage was: {0}", gGenerateProgramResult.UnitTestsCoverage.ToString(CultureInfo.CurrentCulture)]); mesg.Append(Environment.NewLine); mesg.Append(uiLocalizer["Generated Solution File Directory: {0}", gGenerateProgramResult.GeneratedSolutionFileDirectory.ToString(CultureInfo.CurrentCulture)]); mesg.Append(Environment.NewLine); foreach (var assemblyBuilt in gGenerateProgramResult.CollectionOfAssembliesBuilt) { mesg.Append(uiLocalizer["Assembly Built: {0}", assemblyBuilt.ToString(CultureInfo.CurrentCulture)]); mesg.Append(Environment.NewLine); } mesg.Append(uiLocalizer["Packaging was successful: {0}", gGenerateProgramResult.PackagingSuccess.ToString(CultureInfo.CurrentCulture)]); mesg.Append(uiLocalizer["Deployment was successful: {0}", gGenerateProgramResult.DeploymentSuccess.ToString(CultureInfo.CurrentCulture)]); mesg.Append(uiLocalizer["Number of AcceptableExceptions: {0}", gGenerateProgramResult.AcceptableExceptions.Count]); mesg.Append(Environment.NewLine); // List the acceptable Exceptions that occurred //ToDo: break out AcceptableExceptions by type // ToDo: DBExtraction Details, warnings, and Errors // ToDo: Build Details, warnings, and Errors // ToDo: Unit Test Details, warnings, and Errors // ToDo: Unit Test Coverage Details // ToDo: Packaging Details // ToDo: Deployment Details }
public IGGenerateProgramResult InvokeGenerateProgram(IGInvokeGenerateCodeSignil gInvokeGenerateCodeSignil = default) { IGGenerateProgramResult gGenerateProgramResult = default; #region Method timing setup Stopwatch stopWatch = new Stopwatch(); // ToDo: utilize a much more powerfull and ubiquitous timing and profiling tool than a stopwatch stopWatch.Start(); #endregion try { gGenerateProgramResult = gInvokeGenerateCodeSignil.EntryPoints.GenerateProgram(gInvokeGenerateCodeSignil); stopWatch.Stop(); // ToDo: utilize a much more powerfull and ubiquitous timing and profiling tool than a stopwatch // ToDo: put the results someplace } catch (Exception) { // ToDo: define explicit exceptions to catch and report upon // ToDo: catch FileIO.FileNotFound, sometimes the file disappears throw; } finally { // Dispose of the objects that need disposing // SetupResults for PickAndSave, Persistence,and Progress (?) should be disposed in the routine that created them } return(gGenerateProgramResult); }