Game Development Reference
In-Depth Information
public object UserData
{
get { return _userData; }
set { _userData = value; }
}
internal void ElapsedInterval(object sender, ElapsedEventArgs e)
{
if (Triggered != null)
Triggered(sender, new JobTriggeredEventArgs(_mode, _userData));
_schedule.Trigger(_mode, _userData);
if (_mode.Equals(ScheduleMode.Exact))
{
_schedule.Remove(_userData);
}
}
public event EventHandler<JobTriggeredEventArgs> Triggered;
}
The following class describes a job that occurs at a specific date and time.
public class JobExact : JobBase
{
public JobExact(Scheduler schedule,
DateTime startTime,
DateTime finishTime)
: base(schedule, ScheduleMode.Exact)
{
TimeSpan period = finishTime - startTime;
base.JobTimer = new Timer(period.TotalMilliseconds);
base.JobTimer.Elapsed += new ElapsedEventHandler(ElapsedInterval);
base.JobTimer.AutoReset = false;
}
}
The following class describes a job that occurs at a recurring interval.
public class JobSpan : JobBase
{
Search Nedrilad ::




Custom Search