Ejemplo n.º 1
0
        private static void RunCommandLine(string[] args)
        {
            // 命令行格式:  ClownFish.PreheatWebSite.exe  "x:\xxxx\test1.preheat.script"

            string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, args[1]);

            ScriptParser parser   = new ScriptParser();
            ExecuteInfo  execInfo = parser.Parse(filePath);

            if (execInfo.List.Count == 0)
            {
                throw new InvalidOperationException("没有需要执行的任务。");
            }

            ScriptExecutor executor = new ScriptExecutor();

            executor.Execute(execInfo);
        }
Ejemplo n.º 2
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     e.Result = _executor.Execute(_currentExecuteInfo);
 }