public void Render(RecipeReportSelectionModel model) { tbReportName.Text = ReportService.GenerateReportName(); Model = model; cklbRecipes.Items.Clear(); foreach (var recipe in model.Recipes.OrderBy(n => n.Name)) { cklbRecipes.Items.Add(recipe); } RenderFiles(); }
public static RecipeReportSelectionModel GetRecipeSelectionModel() { var model = new RecipeReportSelectionModel(); foreach (var recipe in XmlDal.DataModel.PatternsModel.Patterns) { model.Recipes.Add(new RecipeSelection { Name = recipe.ToString(), RecipeId = recipe.PatternId }); } model.Files = XmlDal.CacheModel.Files.Select(n => n.Path).ToList(); return(model); }
public static void RunReport(RecipeReportSelectionModel model, Action <IStatusModel> statusUpdate, out bool cancelled) { try { Args = new AnalyzeRecipeArgs { StatusUpdate = statusUpdate, Model = model, Report = XmlDal.CacheModel.GetRecipeReport(model.ReportName) }; var tool = new AnalyzeRecipeLoop { Args = Args }; tool.Execute(out cancelled); } finally { statusUpdate(StatusModel.Completed); } }
private void RunRecipeReport(RecipeReportSelectionModel model) { View.StatusUpdate(StatusModel.StartStopWatch); View.StatusUpdate(StatusModel.Update("Running Recipe Report")); ThreadPool.QueueUserWorkItem(delegate { try { View.EnableCancel(true); bool wasCancelled; RecipeReportService.RunReport(model, View.StatusUpdate, out wasCancelled); if (wasCancelled) { View.ReportCancelled(); } RenderDocument(); } finally { View.EnableCancel(false); View.StatusUpdate(StatusModel.Completed); } }); }