/// <summary> /// 添加定时任务 /// </summary> public void AddTimedTask(string deviceId, int portNumber, bool enable, string taskId, ExecType execType = ExecType.Loop, ExecAction execAction = ExecAction.On, int executed = 0, LoopType loopType = LoopType.Day, Moment moment = null, string loopMonent = null) { if (moment == null) { moment = new Moment(0, 0, 0, 0, 0); } _timedTasks.Add(new TimedTask(deviceId, portNumber, enable, taskId, execType, execAction, executed, loopType, moment, loopMonent)) ; }
public TimedTask(string deviceId, int portNumber, bool enabled, string taskId, ExecType execType, ExecAction execAction, int executed, LoopType loopType, Moment moment, string loopMonent) : this() { DeviceId = deviceId; PortNumber = portNumber; Enabled = enabled; TaskId = taskId; ExecType = execType; ExecAction = execAction; Executed = executed;//未执行 执行中 已执行 LoopType = loopType; Moment = moment; LoopMonent = loopMonent; }