コード例 #1
0
        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();
            };
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }