Beispiel #1
0
        private static async Task ProcessBatchAsync(BatchConfig batch, BatchOption option)
        {
            var batchProcessor = Container.Shared.Get <IBatchProcessor>();

            Console.WriteLine($"Processing [{batch.Name}]");
            Console.WriteLine("");

            await batchProcessor.Process(batch, option);
        }
Beispiel #2
0
        protected void rptJobs_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            switch (e.CommandName)
            {
            case "DeleteJob":
                BatchConfig.DeleteJob(e.CommandArgument.ToString());
                break;

            case "RunJob":
                Func <string, int> jobRunner = JobManager.RunCleanerJob;
                jobRunner.BeginInvoke(e.CommandArgument.ToString(), null, null);
                // BatchConfig.RunJob(e.CommandArgument.ToString());
                break;

            case "TestJob":
                Func <string, int> jobTester = JobManager.TestCleanerJob;
                jobTester.BeginInvoke(e.CommandArgument.ToString(), null, null);
                // BatchConfig.RunJob(e.CommandArgument.ToString());
                break;

            case "ShowFiles":
                var filesHit     = new List <string>();
                var filesSkipped = new List <string>();

                JobManager.GetCleanerJobFiles(e.CommandArgument.ToString(), ref filesHit, ref filesSkipped);
                rptFilesHit.DataSource = filesHit;
                rptFilesHit.DataBind();
                rptFilesSkipped.DataSource = filesSkipped;
                rptFilesSkipped.DataBind();

                ShowFilesPanel.Visible = true;

                break;

            case "JobUp":
                BatchConfig.MoveJobUp(e.CommandArgument.ToString());
                break;

            case "JobDn":
                BatchConfig.MoveJobDown(e.CommandArgument.ToString());
                break;
            }

            // refresh saved config
            BatchConfig = null;
            // refill stuff
            FillForm();
        }