Example #1
0
 public void Assign(FScheduleTask task)
 {
     _tasks         = task._tasks;
     _type          = task._type;
     _valid         = task._valid;
     _dayInterval   = task._dayInterval;
     _weekInterval  = task._weekInterval;
     _weekDays      = task._weekDays;
     _monthType     = task._monthType;
     _monthInterval = task._monthInterval;
     _monthDay      = task._monthDay;
     _monthWeek     = task._monthWeek;
     _monthWeekDay  = task._monthWeekDay;
     _months        = task._months;
     _onceDate      = task._onceDate;
     _beginDate     = task._beginDate;
     _endValid      = task._endValid;
     _endDate       = task._endDate;
     _time          = task._time;
     _tag           = task._tag;
 }
Example #2
0
 public virtual void LoadConfig(FXmlNode config)
 {
     // Type
     if (config.Contains(PTY_TYPE))
     {
         _type = REnum.ToValue <EScheduleTaskType>(config[PTY_TYPE]);
     }
     // Valid
     if (config.Contains(PTY_VALID))
     {
         _valid = config.GetBoolean(PTY_VALID);
     }
     // Day Interval
     if (config.Contains(PTY_DAY_INTERVAL))
     {
         _dayInterval = RInt.Parse(config[PTY_DAY_INTERVAL]);
     }
     // Week Interval
     if (config.Contains(PTY_WEEK_INTERVAL))
     {
         _weekInterval = RInt.Parse(config[PTY_WEEK_INTERVAL]);
     }
     // Month Interval
     if (config.Contains(PTY_MONTH_INTERVAL))
     {
         _monthInterval = RInt.Parse(config[PTY_MONTH_INTERVAL]);
     }
     // WeekDays
     if (config.Contains(PTY_WEEKDAYS))
     {
         string weekDays = config[PTY_WEEKDAYS];
         if (!RString.IsEmpty(weekDays))
         {
             _weekDays = (EScheduleWeekDay)RInt.Parse(weekDays);
         }
     }
     // Month type
     if (config.Contains(PTY_MONTH_TYPE))
     {
         string monthType = config[PTY_MONTH_TYPE];
         if (!RString.IsEmpty(monthType))
         {
             _monthType = (EScheduleMonthType)RInt.Parse(monthType);
         }
     }
     // Month day
     if (config.Contains(PTY_MONTH_DAY))
     {
         _monthDay = RInt.Parse(config[PTY_MONTH_DAY]);
     }
     // Month week
     if (config.Contains(PTY_MONTH_WEEK))
     {
         string monthWeek = config[PTY_MONTH_WEEK];
         if (!RString.IsEmpty(monthWeek))
         {
             _monthWeek = (EScheduleMonthWeek)RInt.Parse(monthWeek);
         }
     }
     // Month week day
     if (config.Contains(PTY_MONTH_WEEK_DAY))
     {
         _monthWeekDay = RInt.Parse(config[PTY_MONTH_WEEK_DAY]);
     }
     // Months
     if (config.Contains(PTY_MONTHS))
     {
         string months = config[PTY_MONTHS];
         if (!RString.IsEmpty(months))
         {
             _months = (EScheduleMonth)RInt.Parse(months);
         }
     }
     // Once date
     if (config.Contains(PTY_ONCE_DATE))
     {
         _onceDate = RDate.Parse(config[PTY_ONCE_DATE]);
     }
     // Begin date
     if (config.Contains(PTY_BEGIN_DATE))
     {
         _beginDate = RDate.Parse(config[PTY_BEGIN_DATE]);
     }
     // End valid
     if (config.Contains(PTY_END_VALID))
     {
         _endValid = config.GetBoolean(PTY_END_VALID);
     }
     // End date
     if (config.Contains(PTY_END_DATE))
     {
         _endDate = RDate.Parse(config[PTY_END_DATE]);
     }
     // Time
     if (config.Contains(PTY_TIME))
     {
         _time = RDate.Parse(config[PTY_TIME]);
     }
 }