示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="DroneTaskContext" /> class.
        /// </summary>
        /// <param name="module">The module from where the task came from.</param>
        /// <param name="task">The task being executed.</param>
        /// <param name="env">The env.</param>
        /// <param name="log">The task log.</param>
        /// <param name="taskRunner">The run task function use to run other tasks.</param>
        /// <exception cref="System.ArgumentNullException">module
        /// or
        /// task
        /// or
        /// config
        /// or
        /// taskLog
        /// or
        /// runTask</exception>
        public DroneTaskContext(
			DroneModule module,
			DroneTask task, 
			DroneEnv env,
			Logger log, 
			DroneTaskRunner taskRunner)
        {
            if(module == null)
                throw new ArgumentNullException("module");

            if(task == null)
                throw new ArgumentNullException("task");

            if(env == null)
                throw new ArgumentNullException("env");

            if(log == null)
                throw new ArgumentNullException("log");

            if(taskRunner == null)
                throw new ArgumentNullException("taskRunner");

            this.Module = module;
            this.Task = task;
            this.Env = env;
            this.Log = log;
            this.taskRunner = taskRunner;
        }
示例#2
0
 public DroneService()
 {
     this.log = DroneLogManager.GetLog();
     this.store = new JsonStore();
     this.compiler = new DroneCompiler();
     this.loader = new DroneLoader();
     this.taskRunner = new DroneTaskRunner(new DroneTaskHandlerFactory());
 }