private void mmRunTarget_Click(object sender, EventArgs e) { if (runTargetForm.ShowDialog() != DialogResult.OK) { return; } CloseViews(); var runner = new TargetRunner { RunTargetForm = runTargetForm }; runner.Execute(this); ServiceContainer.getService <IReportService>().Open(runner.Report); var reportService = ServiceContainer.getService <IReportService>() as CoverageReportService; if (reportService != null) { reportService.LastRunLog = runner.RunLog.ToString(); } if (runner.Report.Assemblies.Count == 0) { ShowEmptyReportDialog(runner.Report); } else { ProcessReportReceived(runner.Report); } }
void DisplayDebugMenu(Rect pos) { var node = mContextNode == null ? null : mContextNode.GetRuntimeNode(); if (node == null) { return; } BehaviourTreeRunner.AssetBinder subtree = null; if (node != null && node.Asset != null && TargetRunner != null) { subtree = TargetRunner.GetBinder((x) => x.Name == node.Asset.GetInstanceID().ToString("x")); } if (subtree != null && subtree.RuntimeTree != null) { sDebugMenu.AddItem("打开子行为树", (menu, index, data) => { mAssetBinder.SetBehaviourBinder(data as BehaviourTreeRunner.AssetBinder); mContextNode = null; }, subtree); } else { sDebugMenu.RemoveItem("打开子行为树"); } sDebugMenu.Display(this, pos); }
public BuildSession(Arguments arguments) { Parameters = arguments.Parameters.ToDictionary(x => x.Key, x => x.Value); Verbosity = arguments.Verbosity; _services = new Dictionary <Type, object>(); _services.Add(typeof(IBuildSession), this); var tracer = new Tracer(this); _services.Add(typeof(Tracer), tracer); foreach (var listener in arguments.Listeners) { var listenerType = Type.GetType(listener, false, true); if (listenerType == null) { listenerType = Type.GetType("BuildCs.Tracing." + listener, false, true); if (listenerType == null) { throw new BuildCsException("Listener of type '{0}' could not be found.".F(listenerType)); } } tracer.Listeners.Add((IBuildListener)Activator.CreateInstance(listenerType, new object[] { this })); } var targetManager = new TargetManager(); _services.Add(typeof(TargetManager), targetManager); var targetRunner = new TargetRunner(targetManager, tracer); _services.Add(typeof(TargetRunner), targetRunner); arguments.TargetNames.Each(t => targetRunner.TargetsToRun.Add(t)); }
private void mmRunTarget_Click(object sender, EventArgs e) { if (runTargetForm.ShowDialog() != DialogResult.OK) return; CloseViews(); var runner = new TargetRunner { RunTargetForm = runTargetForm }; runner.Execute(this); ServiceContainer.getService<IReportService>().Open(runner.Report); var reportService = ServiceContainer.getService<IReportService>() as CoverageReportService; if (reportService != null) { reportService.LastRunLog = runner.RunLog.ToString(); } if (runner.Report.Assemblies.Count == 0) { ShowEmptyReportDialog(runner.Report); } else { ProcessReportReceived(runner.Report); } }
private void mmRunTarget_Click(object sender, EventArgs e) { if (runTargetForm.ShowDialog() != DialogResult.OK) return; CloseViews(); TargetRunner runner = new TargetRunner(); runner.RunTargetForm = runTargetForm; runner.execute(this); try { if (runner.Report.assemblies.Count == 0) { ShowInformation("Report is empty. Check settings and run target again."); return; } } catch (Exception ex) { ShowError("Cannot get report! (" + ex.Message + ")"); return; } if (runTargetForm.OutputToFile) { DefaultReportWriter reportWriter = new DefaultReportWriter(); StreamWriter writer = new StreamWriter(dlgSave.FileName); reportWriter.WriteReport(runner.Report, writer); writer.Close(); } else { ServiceContainer.GetService<ICoverageReportService>().Load(runner.Report); } }