public override async Task Execute(IReportContext context, ReportPhase phase, IScope scope = null) { context.SetHeader("Content-Type", "text/html"); context.Write("<textarea>"); context.Write(context.Data.stringify()); context.Write("</textarea>"); }
private async Task ExecutePhase(IReportContext context, ReportPhase phase, IScope scope) { Logg.Debug(new { op = "start phase", phase }); var agents = context.Agents.Where(_ => _.Phase.HasFlag(phase)).OrderBy(_ => _.Idx).GroupBy(_ => _.Idx).ToArray(); foreach (var grp in agents) { if (grp.Count() == 1) { await grp.First().Execute(context, phase, scope); } else if (grp.All(_ => _.Parallel)) { var waitgroup = new List <Task>(); foreach (var agent in grp) { waitgroup.Add(agent.Execute(context, phase, scope)); } Task.WaitAll(waitgroup.ToArray()); } else { foreach (var agent in grp) { await agent.Execute(context, phase, scope); } } } Logg.Debug(new { op = "end phase", phase }); }
public override async Task Execute(IReportContext context, ReportPhase phase, IScope scope = null) { context.SetHeader("Content-Type","text/html"); context.Write("<textarea>"); context.Write(context.Data.stringify()); context.Write("</textarea>"); }
public override async Task Execute(IReportContext context, ReportPhase phase, IScope scope = null) { SetupMime(context); if (BuildHtml) { DoBuildHtml(context, scope); } else { DoStreamRender(context, scope); } }
public override async Task Execute(IReportContext context, ReportPhase phase, IScope scope = null) { SetupMime(context); if (BuildHtml) { DoBuildHtml(context, scope); } else { DoStreamRender(context, scope); } }
private async Task ExecutePhase(IReportContext context, ReportPhase phase,IScope scope) { Logg.Debug(new {op="start phase",phase}); var agents = context.Agents.Where(_ => _.Phase.HasFlag(phase)).OrderBy(_ => _.Idx).GroupBy(_ => _.Idx).ToArray(); foreach (var grp in agents) { if (grp.Count() == 1) { await grp.First().Execute(context, phase, scope); } else if (grp.All(_ => _.Parallel)) { var waitgroup = new List<Task>(); foreach (var agent in grp) { waitgroup.Add(agent.Execute(context, phase, scope)); } Task.WaitAll(waitgroup.ToArray()); } else { foreach (var agent in grp) { await agent.Execute(context, phase, scope); } } } Logg.Debug(new { op = "end phase", phase }); }
public override async Task Execute(IReportContext context, ReportPhase phase, IScope scope = null) { context.Data["x"] = 1; }
public abstract Task Execute(IReportContext context, ReportPhase phase, IScope scope = null);
public override async Task Execute(IReportContext context, ReportPhase phase, IScope scope = null) { context.Data["x"] = 1; }