fCraft  0.638
Custom Minecraft Server
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events
fCraft.SchedulerTask Class Reference

A task to be executed by the Scheduler. Stores timing information and state. More...

Public Member Functions

SchedulerTask RunOnce ()
 Runs the task once, as quickly as possible. Callback is invoked from the Scheduler thread.
 
SchedulerTask RunOnce (TimeSpan delay)
 Runs the task once, after a given delay.
 
SchedulerTask RunOnce (DateTime time)
 Runs the task once at a given date. If the given date is in the past, the task is ran immediately.
 
SchedulerTask RunOnce (object userState, TimeSpan delay)
 Runs the task once, after a given delay.
 
SchedulerTask RunOnce (object userState, DateTime time)
 Runs the task once at a given date. If the given date is in the past, the task is ran immediately.
 
SchedulerTask RunForever (TimeSpan interval)
 Runs the task forever at a given interval, until manually stopped.
 
SchedulerTask RunForever (TimeSpan interval, TimeSpan delay)
 Runs the task forever at a given interval after an initial delay, until manually stopped.
 
SchedulerTask RunForever (object userState, TimeSpan interval, TimeSpan delay)
 Runs the task forever at a given interval after an initial delay, until manually stopped.
 
SchedulerTask RunRepeating (TimeSpan delay, TimeSpan interval, int times)
 Runs the task a given number of times, at a given interval after an initial delay.
 
SchedulerTask RunRepeating ([CanBeNull] object userState, TimeSpan delay, TimeSpan interval, int times)
 Runs the task a given number of times, at a given interval after an initial delay.
 
SchedulerTask RunManual ()
 Executes the task once immediately, and suspends (but does not stop). A SchedulerTask object can be reused many times if ran manually.
 
SchedulerTask RunManual (TimeSpan delay)
 Executes the task once after a delay, and suspends (but does not stop). A SchedulerTask object can be reused many times if ran manually.
 
SchedulerTask RunManual (DateTime time)
 Executes the task once at a given time, and suspends (but does not stop). A SchedulerTask object can be reused many times if ran manually.
 
SchedulerTask Stop ()
 Stops the task, and removes it from the schedule.
 
override string ToString ()
 

Properties

DateTime NextTime [get, set]
 Next scheduled execution time (UTC).
 
TimeSpan Delay [get, set]
 Initial execution delay.
 
bool IsRecurring [get, set]
 Whether the task is one-use or recurring.
 
bool IsBackground [get, set]
 Whether the task should be ran in the background.
 
bool IsStopped [get, set]
 Whether the task has stopped. RunOnce tasks stop after first execution. RunForever and RunManual tasks only stop manually. RunRepeating stops after max number of repeats is reached.
 
bool IsExecuting [get, set]
 Whether the task is currently being executed.
 
bool AdjustForExecutionTime [get, set]
 Whether to adjust Interval for execution time (for recurring tasks). If enabled, the Interval timer is started as soon as execution starts. Total delay between executions is then equal to Interval. If disabled, the Interval timer is started only after execution finishes. Total delay between executions is then (time to execute + Interval).
 
TimeSpan Interval [get, set]
 Interval between executions (for recurring tasks).
 
int MaxRepeats [get, set]
 Maximum number of repeats for RunRepeating tasks. Set to -1 to run forever.
 
bool IsCritical [get, set]
 Whether this task should be allowed to finish after server shutdown.
 
SchedulerCallback Callback [get, set]
 Method to call to execute the task.
 
object UserState [get, set]
 General-purpose persistent state object, can be used for anything you want.
 

Detailed Description

A task to be executed by the Scheduler. Stores timing information and state.

Member Function Documentation

SchedulerTask fCraft.SchedulerTask.RunForever ( TimeSpan  interval)

Runs the task forever at a given interval, until manually stopped.

SchedulerTask fCraft.SchedulerTask.RunForever ( TimeSpan  interval,
TimeSpan  delay 
)

Runs the task forever at a given interval after an initial delay, until manually stopped.

SchedulerTask fCraft.SchedulerTask.RunForever ( object  userState,
TimeSpan  interval,
TimeSpan  delay 
)

Runs the task forever at a given interval after an initial delay, until manually stopped.

SchedulerTask fCraft.SchedulerTask.RunManual ( )

Executes the task once immediately, and suspends (but does not stop). A SchedulerTask object can be reused many times if ran manually.

SchedulerTask fCraft.SchedulerTask.RunManual ( TimeSpan  delay)

Executes the task once after a delay, and suspends (but does not stop). A SchedulerTask object can be reused many times if ran manually.

SchedulerTask fCraft.SchedulerTask.RunManual ( DateTime  time)

Executes the task once at a given time, and suspends (but does not stop). A SchedulerTask object can be reused many times if ran manually.

SchedulerTask fCraft.SchedulerTask.RunOnce ( )

Runs the task once, as quickly as possible. Callback is invoked from the Scheduler thread.

SchedulerTask fCraft.SchedulerTask.RunOnce ( TimeSpan  delay)

Runs the task once, after a given delay.

SchedulerTask fCraft.SchedulerTask.RunOnce ( DateTime  time)

Runs the task once at a given date. If the given date is in the past, the task is ran immediately.

SchedulerTask fCraft.SchedulerTask.RunOnce ( object  userState,
TimeSpan  delay 
)

Runs the task once, after a given delay.

SchedulerTask fCraft.SchedulerTask.RunOnce ( object  userState,
DateTime  time 
)

Runs the task once at a given date. If the given date is in the past, the task is ran immediately.

SchedulerTask fCraft.SchedulerTask.RunRepeating ( TimeSpan  delay,
TimeSpan  interval,
int  times 
)

Runs the task a given number of times, at a given interval after an initial delay.

SchedulerTask fCraft.SchedulerTask.RunRepeating ( [CanBeNull] object  userState,
TimeSpan  delay,
TimeSpan  interval,
int  times 
)

Runs the task a given number of times, at a given interval after an initial delay.

SchedulerTask fCraft.SchedulerTask.Stop ( )

Stops the task, and removes it from the schedule.

override string fCraft.SchedulerTask.ToString ( )

Property Documentation

bool fCraft.SchedulerTask.AdjustForExecutionTime
getset

Whether to adjust Interval for execution time (for recurring tasks). If enabled, the Interval timer is started as soon as execution starts. Total delay between executions is then equal to Interval. If disabled, the Interval timer is started only after execution finishes. Total delay between executions is then (time to execute + Interval).

SchedulerCallback fCraft.SchedulerTask.Callback
getset

Method to call to execute the task.

TimeSpan fCraft.SchedulerTask.Delay
getset

Initial execution delay.

TimeSpan fCraft.SchedulerTask.Interval
getset

Interval between executions (for recurring tasks).

bool fCraft.SchedulerTask.IsBackground
getset

Whether the task should be ran in the background.

bool fCraft.SchedulerTask.IsCritical
getset

Whether this task should be allowed to finish after server shutdown.

bool fCraft.SchedulerTask.IsExecuting
getset

Whether the task is currently being executed.

bool fCraft.SchedulerTask.IsRecurring
getset

Whether the task is one-use or recurring.

bool fCraft.SchedulerTask.IsStopped
getset

Whether the task has stopped. RunOnce tasks stop after first execution. RunForever and RunManual tasks only stop manually. RunRepeating stops after max number of repeats is reached.

int fCraft.SchedulerTask.MaxRepeats
getset

Maximum number of repeats for RunRepeating tasks. Set to -1 to run forever.

DateTime fCraft.SchedulerTask.NextTime
getset

Next scheduled execution time (UTC).

object fCraft.SchedulerTask.UserState
getset

General-purpose persistent state object, can be used for anything you want.


The documentation for this class was generated from the following file: