private void _SetupExport() { controller.Exporting += (jm) => { Root.Sensitive = false; GLib.Idle.Add(() => { float progress = 0; int jobsTotal, jobsDone; if (jm.AllJobsDone(out progress, out jobsDone, out jobsTotal)) { controller.HandleExportResults(jm.Results); ProgressWidget.Fraction = progress; ProgressWidget.Text = String.Format("All jobs done({0})!", jobsDone); Root.Sensitive = true; return(false); } else { ProgressWidget.Text = String.Format("{0} / {1} jobs done.", jobsDone, jobsTotal); ProgressWidget.Fraction = progress; return(true); } }); }; BuildButton.Clicked += (sender, e) => { ExportJobManager jm = controller.ExportAll(); }; BuildObsolete.Clicked += (sender, e) => { ExportJobManager jm = controller.ExportObsolete(); }; }
public ExportJobManager Export(ExportList list, List <ElementExportSettings> tvgs) { ExportJobManager manager = new ExportJobManager(); foreach (ElementExportSettings tvg in tvgs) { manager.AddJob(this, list, tvg); } Exporting(manager); manager.RunJobs(); return(manager); }
public ExportJobManager ExportAll() { ExportJobManager manager = new ExportJobManager(); foreach (ExportList list in pf.ExportList) { foreach (ElementExportSettings tvg in list.Elements) { manager.AddJob(this, list, tvg); } } Exporting(manager); manager.RunJobs(); return(manager); }
public ExportJobManager ExportObsolete() { ExportJobManager manager = new ExportJobManager(); foreach (ExportList list in pf.ExportList) { foreach (ElementExportSettings tvg in list.Elements) { if (tvg.ExportStatus == ElementExportSettings.LastExportStatus.Obsolete) { manager.AddJob(this, list, tvg); } } } Exporting(manager); manager.RunJobs(); return(manager); }