예제 #1
0
        public void RunJobs()
        {
            running = true;
            int i = 0;

            foreach (ExportJob job in jobs)
            {
                UTransformController controller = new UTransformController(ProjectController.ConfigController, i);
                i++;
                Interlocked.Increment(ref jobCounter);

                ThreadPool.QueueUserWorkItem((state) => {
                    ExportResult result;
                    try {
                        controller.Export(job.projectController, job.exportList, job.tvg, out result);
                    } catch (Exception e) {
                        result = new ExportResult(job.tvg);
                        result.Error(e.GetType() + "\n" + e.StackTrace + "\n" + e.Message);
                    }
                    ExportLogs.Enqueue(result);

                    Interlocked.Decrement(ref jobCounter);
                });
            }
        }
예제 #2
0
        /// <summary>
        /// Creates a new empty project
        /// </summary>
        private ProjectController(ProjectFile file, Uri fileLocation)
        {
            pf = file;
            this.FileLocation = fileLocation;
            ExportController  = new ExportListController(this);
            ExportController.UpdateExportLists(file.ExportList);

            UTransformController = new UTransformController(ConfigController);
        }