Quartz.NET usage
2012-07-26 22:35:32 Moscow time
Have just tried the Quartz.NET 2.x library. See Quartz.NET - Version Migration Guide.
// Construct a scheduler factory.
var collection = new NameValueCollection
{
{ "quartz.threadPool.threadCount", "3" }
};
var schedulerFactory = new StdSchedulerFactory(collection);
// Get a scheduler.
var scheduler = schedulerFactory.GetScheduler();
scheduler.Start();
var jobDetail = JobBuilder.Create()
.Build();
var trigger = TriggerBuilder.Create()
.StartAt(DateBuilder.FutureDate(10, IntervalUnit.Second))
.WithSimpleSchedule(x => x.WithIntervalInSeconds(5).RepeatForever())
.Build();
scheduler.ScheduleJob(jobDetail, trigger);
// To unschedule job use:
// scheduler.UnscheduleJob(trigger.Key);