private Task <Workspace> WithAnalysisProgressReportingAsync(int numSpecsTotal, Task <Workspace> task) { var counter = m_frontEndStatistics.SpecTypeChecking; return(TaskUtilities.AwaitWithProgressReporting( task, EvaluationProgressReportingPeriod, (elapsed) => { m_logger.FrontEndWorkspaceAnalysisPhaseProgress(FrontEndContext.LoggingContext, counter.Count, numSpecsTotal); NotifyProgress(WorkspaceProgressEventArgs.Create(ProgressStage.Analysis, counter.Count, numSpecsTotal)); })); }
private async Task <bool> WithConversionProgressReportingAsync(int totalSpecs, Task <bool[]> task) { var counter = m_frontEndStatistics.SpecConversion; var results = await TaskUtilities.AwaitWithProgressReporting( task, period : EvaluationProgressReportingPeriod, action : (elapsed) => { m_logger.FrontEndConvertPhaseProgress(FrontEndContext.LoggingContext, counter.Count, totalSpecs); NotifyProgress(WorkspaceProgressEventArgs.Create(ProgressStage.Conversion, counter.Count, totalSpecs)); }); return(results.All(t => t)); }
private Task <Workspace> WithWorkspaceProgressReportingAsync(int?numSpecs, Task <Workspace> task) { var numParseTotal = numSpecs?.ToString(CultureInfo.InvariantCulture) ?? "?"; var counter = m_frontEndStatistics.SpecBinding; return(TaskUtilities.AwaitWithProgressReporting( task, EvaluationProgressReportingPeriod, (elapsed) => { m_logger.FrontEndWorkspacePhaseProgress(FrontEndContext.LoggingContext, counter.Count, numParseTotal); NotifyProgress(WorkspaceProgressEventArgs.Create(ProgressStage.Parse, counter.Count, numSpecs)); })); }