Beispiel #1
0
        public static void AssignQuartzTrigger(this CronTriggerImpl cronTrigger, IXpandCronTrigger trigger)
        {
            cronTrigger.MisfireInstruction   = (int)trigger.MisfireInstruction;
            cronTrigger.CronExpressionString = trigger.CronExpression;
            // http://devexpress.com/Support/Center/p/S133718.aspx?searchtext=timezoneid+number
            // Fetches the Windows name of the specified Scheduler time zone from the registry.
            String timeZoneKey = RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(trigger.TimeZone);

            cronTrigger.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneKey);
        }
Beispiel #2
0
 static void InitializeAnnual(AnnualCalendar annualCalendar, IAnnualCalendar calendar)
 {
     annualCalendar.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(calendar.TimeZone));
     calendar.DatesExcluded.ForEach(time => annualCalendar.SetDayExcluded(time, true));
     calendar.DatesIncluded.ForEach(time => annualCalendar.SetDayExcluded(time, false));
 }
Beispiel #3
0
 static void InitializeHoliday(HolidayCalendar holidayCalendar, IHolidayCalendar calendar)
 {
     holidayCalendar.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(calendar.TimeZone));
     calendar.DatesExcluded.ForEach(holidayCalendar.AddExcludedDate);
 }
Beispiel #4
0
 static void InitializeWeekly(WeeklyCalendar weeklyCalendar, IWeeklyCalendar calendar)
 {
     weeklyCalendar.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(calendar.TimeZone));
     calendar.DaysOfWeekExcluded.ForEach(week => weeklyCalendar.SetDayExcluded(week, true));
     calendar.DaysOfWeekIncluded.ForEach(week => weeklyCalendar.SetDayExcluded(week, false));
 }
Beispiel #5
0
 static void InitializeMonthly(MonthlyCalendar monthlyCalendar, IMonthlyCalendar calendar)
 {
     monthlyCalendar.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(calendar.TimeZone));
     calendar.DaysExcluded.ForEach(i => monthlyCalendar.SetDayExcluded(i, true));
     calendar.DaysIncluded.ForEach(i => monthlyCalendar.SetDayExcluded(i, false));
 }
Beispiel #6
0
 static void InitializeDaily(DailyCalendar dailyCalendar, IDailyCalendar calendar)
 {
     dailyCalendar.TimeZone = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(calendar.TimeZone));
     calendar.DateRanges.ToList().ForEach(range => dailyCalendar.SetTimeRange(range.StartPoint, range.EndPoint));
 }
Beispiel #7
0
 static void InitializeCron(CronCalendar cronCalendar, ICronCalendar calendar)
 {
     cronCalendar.TimeZone       = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(calendar.TimeZone));
     cronCalendar.CronExpression = new CronExpression(calendar.CronExpression);
 }
Beispiel #8
0
 public static void AssignQuartzTrigger(this NthIncludedDayTrigger nthIncludedDayTrigger, INthIncludedDayTrigger trigger)
 {
     nthIncludedDayTrigger.MisfireInstruction = (int)trigger.MisfireInstruction;
     nthIncludedDayTrigger.N                             = trigger.N;
     nthIncludedDayTrigger.IntervalType                  = (int)trigger.IntervalType;
     nthIncludedDayTrigger.FireAtTime                    = string.Format(CultureInfo.InvariantCulture, "{0:00}:{1:00}:{2:00}", trigger.FireAtTime.Hours, trigger.FireAtTime.Minutes, trigger.FireAtTime.Seconds);
     nthIncludedDayTrigger.NextFireCutoffInterval        = trigger.NextFireCutoffInterval;
     nthIncludedDayTrigger.TimeZone                      = TimeZoneInfo.FindSystemTimeZoneById(RegistryTimeZoneProvider.GetRegistryKeyNameByTimeZoneId(trigger.TimeZone));
     nthIncludedDayTrigger.TriggerCalendarFirstDayOfWeek = trigger.TriggerCalendarFirstDayOfWeek;
     nthIncludedDayTrigger.TriggerCalendarWeekRule       = trigger.TriggerCalendarWeekRule;
 }