Пример #1
0
 public void UpdateExpression()
 {
     _selectedMinuteCronSetting  = CommonMinuteCronSettings.FirstOrDefault(x => x.Minute == Minute);
     _selectedHourCronSetting    = CommonHourCronSettings.FirstOrDefault(x => x.Hour == Hour);
     _selectedDayCronSetting     = CommonDayCronSettings.FirstOrDefault(x => x.Day == Day);
     _selectedMonthCronSetting   = CommonMonthCronSettings.FirstOrDefault(x => x.Month == Month);
     _selectedWeekdayCronSetting = CommonWeekdayCronSettings.FirstOrDefault(x => x.Weekday == Weekday);
     RaisePropertyChanged(nameof(SelectedMinuteCronSetting));
     RaisePropertyChanged(nameof(SelectedHourCronSetting));
     RaisePropertyChanged(nameof(SelectedDayCronSetting));
     RaisePropertyChanged(nameof(SelectedMonthCronSetting));
     RaisePropertyChanged(nameof(SelectedWeekdayCronSetting));
     Expression           = string.Format("{0} {1} {2} {3} {4}", Minute, Hour, Day, Month, Weekday);
     _selectedCronSetting = CommonCronSettings.FirstOrDefault(x => x.Expression == Expression);
     RaisePropertyChanged(nameof(SelectedCronSetting));
 }
Пример #2
0
 public void UpdateCronSetting(CommonCronSetting cronSetting)
 {
     if (!string.IsNullOrEmpty(cronSetting.Minute))
     {
         Minute = cronSetting.Minute;
     }
     if (!string.IsNullOrEmpty(cronSetting.Hour))
     {
         Hour = cronSetting.Hour;
     }
     if (!string.IsNullOrEmpty(cronSetting.Day))
     {
         Day = cronSetting.Day;
     }
     if (!string.IsNullOrEmpty(cronSetting.Month))
     {
         Month = cronSetting.Month;
     }
     if (!string.IsNullOrEmpty(cronSetting.Weekday))
     {
         Weekday = cronSetting.Weekday;
     }
 }