private static PlanConfig CreatePlan(PlanCallback callback, string name, PlanCycle planCycle, string beginTime, string endTime = "", bool isCycle = false, int secondInterval = 0) { return(new PlanConfig() { Callback = callback, Name = name, PlanCycle = planCycle, BeginTime = beginTime, EndTime = endTime, IsCycle = isCycle, SecondInterval = secondInterval }); }
private PlanConfig(PlanCallback callback, PlanCycle planCycle, string beginTime, string endTime, bool isCycle, int secondInterval, string name) { Callback = callback; _planCycle = planCycle; _beginTime = beginTime; Name = name; _endTime = string.IsNullOrEmpty(endTime) ? "23:59:59" : endTime; IsCycle = isCycle; SecondInterval = secondInterval > 0 ? secondInterval : 0; _beginDate = _beginTime.ToDateTime(); _endDate = _endTime.ToDateTime(); }
/// <summary> /// /// </summary> /// <param name="callback"></param> /// <param name="name"></param> /// <param name="planCycle">PlanCycle</param> /// <param name="beginTime">more than or equal this time, format: "2015/01/01 09:00:00", or "09:00:00" is today time</param> /// <param name="endTime">less than this time, format: "2015/01/02 00:00:00", or "00:00:00" or "null" is tomorrow time</param> /// <param name="isCycle">is cycle run</param> /// <param name="secondInterval">interval run times</param> /// <param name="target"></param> /// <returns></returns> private static PlanConfig CreatePlan(PlanCallback callback, string name, PlanCycle planCycle, string beginTime, string endTime, bool isCycle, int secondInterval, object target) { return(new PlanConfig() { Callback = callback, Name = name, PlanCycle = planCycle, BeginTime = beginTime, EndTime = endTime ?? string.Empty, IsCycle = isCycle, SecondInterval = secondInterval, Target = target }); }
/// <summary> /// /// </summary> /// <param name="callback"></param> /// <param name="name"></param> /// <param name="planCycle">PlanCycle</param> /// <param name="beginTime">more than or equal this time, format: "2015/01/01 09:00:00", or "09:00:00" is today time</param> /// <param name="endTime">less than this time, format: "2015/01/02 00:00:00", or "00:00:00" or "null" is tomorrow time</param> /// <param name="isCycle">is cycle run</param> /// <param name="secondInterval">interval run times</param> /// <param name="target"></param> /// <returns></returns> private static PlanConfig CreatePlan(PlanCallback callback, string name, PlanCycle planCycle, string beginTime, string endTime, bool isCycle, int secondInterval, object target) { return new PlanConfig() { Callback = callback, Name = name, PlanCycle = planCycle, BeginTime = beginTime, EndTime = endTime ?? string.Empty, IsCycle = isCycle, SecondInterval = secondInterval, Target = target }; }
private static PlanConfig CreatePlan(PlanCallback callback, string name, PlanCycle planCycle, string beginTime, string endTime = "", bool isCycle = false, int secondInterval = 0) { return new PlanConfig() { Callback = callback, Name = name, PlanCycle = planCycle, BeginTime = beginTime, EndTime = endTime, IsCycle = isCycle, SecondInterval = secondInterval }; }