Пример #1
0
        /// <summary>
        /// Run Import tasks
        /// </summary>
        /// <param name="start">Job start function</param>
        /// <param name="task">Task run function</param>
        /// <param name="end">Job end function</param>
        /// <param name="streamLog">Stream output</param>
        /// <returns>Task</returns>
        public async Task ImportRunAsync(Action <string> start, Action <string, int> task, Action <string> end, bool streamLog = false)
        {
            if (this.Files == null || this.Files.Count == 0)
            {
                end("No task to process");
                return;
            }

            Func <string> prepare = () =>
            {
                // Write Log
                string result = FormatCli.H1("Job");
                result += this.OverviewExport();

                return(result);
            };

            await this.TaskRun(prepare, this.Files.Count, this._ImportRunTaskAsync, start, task, end, streamLog);
        }
Пример #2
0
        /// <summary>
        /// Dry run export tasks and only get parameters
        /// </summary>
        /// <param name="start">Job start function</param>
        /// <param name="task">Task run function</param>
        /// <param name="end">Job end function</param>
        /// <param name="streamLog">Stream output</param>
        /// <returns>Task</returns>
        public async Task ExportParamsAsync(Action <string> start, Action <string, int> task, Action <string> end, bool streamLog = false)
        {
            if (this.Tasks == 0)
            {
                end("No task to process");
                return;
            }

            Func <string> prepare = () =>
            {
                // Prepare
                this.ExportPrepare();

                // Write Log
                string result = FormatCli.H1("Job");
                result += this.OverviewExport();

                return(result);
            };

            await this.TaskRun(prepare, this.Tasks, this._ExportParamsAsync, start, task, end, streamLog);
        }