views:

79

answers:

1

So I've decided to use Quartz.NET to schedule some tasks for me in my application and I'd like to schedule my tasks to run daily from the following 3 pieces of information.

TimeSpan startTime //i.e. 10:30
TimeSpan endTime // i.e. 18:30
TimeSpan repeatInterval // 30 Minutes

And the trigger will fire every day at 10:30, 11:00, 11:30...18:30

Seems pretty simple right? But I can't seem to find anything in the TriggerUtils that would allow me to do something like this. I've also tried the CronTrigger route but it doesn't seem very clean for intervals like 90 seconds.

If there's a built in way to do this I'd love to use it but if not I'm ready to roll my own Trigger. Any pointers for implementing a Trigger from scratch (which methods need to be overridden etc.) would also be much appreciated.

+1  A: 

You could define a SimpleTrigger with the repeat interval you want and restrict it to run within a daily time range with a DailyCalendar.

Mauricio Scheffer