Project DescriptionA lightweight task scheduling library that allows you to easily schedule the invocation of callback methods at specified times or intervals. Supports .NET 3.5 and Silverlight.
The library allows you to include flexibule scheduling functionality into your application with just a few lines of code, and provides a fluent API to configure jobs:
private Scheduler scheduler = new Scheduler();
private void CreateJob()
{
DateTime startTime = ...;
DateTime expirationTime = ...;
//create job that executes every 1.5 seconds until it expires
Job job = new Job("Job 1");
job.Run.From(startTime).Every.Seconds(1.5).Until(expirationTime);
//submit to scheduler
scheduler.SubmitJob(job, OnJobExecution);
}
//the callback handler that is invoked every time the job is due
private void OnJobExecution(Job job)
{
//process job
...
//the job can be aborted directly via the callback method
if (...)
{
job.Cancel();
}
}
Samples and a description of the API can be found in this blog post:http://www.hardcodet.net/2010/01/lightweight-task-slash-job-scheduling-with-silverlight-support