Ejemplo n.º 1
0
 public bool TaskExist(PtiRunner runner)
 {
     lock (locker)
     {
         return(this.RunnerList.Contains(runner));
     }
 }
Ejemplo n.º 2
0
        public bool CreateRunner(PtiRunTask runTask)
        {
            if (string.IsNullOrWhiteSpace(runTask.PtiTasker.RunCmd))
            {
                runTask.PtiTasker.RunCmd = runTask.PtiApp.DefaultRunCmd;
            }
            PtiRunner runner = new PtiRunner(runTask.PtiTasker, runTask.PtiApp);

            this.RunnerList.Add(runner);
            runTask.Runner = runner;
            return(true);
        }
Ejemplo n.º 3
0
        public bool RemoveRunner(PtiRunner runner)
        {
            try
            {
                runner.TaskInfo.TaskState = TaskState.STOP;
                lock (locker)
                {
                    this.RunnerList.Remove(runner);
                }

                //TaskManager.Get().RemoveTaskById(runner.TaskInfo._id);
            }
            catch (Exception ex)
            {
                this.WriteError(ex.ToString());
                return(false);
            }
            return(true);
        }