Class ControlScheduler
Represents an object that schedules units of work using the UI thread of a Windows Forms control.
public class ControlScheduler : IScheduler
- Inheritance
-
ControlScheduler
- Implements
- Inherited Members
Constructors
ControlScheduler(Control)
Initializes a new instance of the ControlScheduler class using the specified control.
public ControlScheduler(Control control)
Parameters
Properties
Control
Gets the control object used to schedule units of work.
public Control Control { get; }
Property Value
Now
Gets the current time according to the local machine's system clock.
public DateTimeOffset Now { get; }
Property Value
Methods
Schedule<TState>(TState, DateTimeOffset, Func<IScheduler, TState, IDisposable>)
Schedules an action to be executed at dueTime.
public IDisposable Schedule<TState>(TState state, DateTimeOffset dueTime, Func<IScheduler, TState, IDisposable> action)
Parameters
state
TStateState passed to the action to be executed.
dueTime
DateTimeOffsetAbsolute time at which to execute the action.
action
Func<IScheduler, TState, IDisposable>Action to be executed.
Returns
- IDisposable
The disposable object used to cancel the scheduled action (best effort).
Type Parameters
TState
The type of the state passed to the scheduled action.
Schedule<TState>(TState, Func<IScheduler, TState, IDisposable>)
Schedules an action to be executed.
public IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
Parameters
state
TStateState passed to the action to be executed.
action
Func<IScheduler, TState, IDisposable>Action to be executed.
Returns
- IDisposable
The disposable object used to cancel the scheduled action (best effort).
Type Parameters
TState
The type of the state passed to the scheduled action.
Schedule<TState>(TState, TimeSpan, Func<IScheduler, TState, IDisposable>)
Schedules an action to be executed after dueTime.
public IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
Parameters
state
TStateState passed to the action to be executed.
dueTime
TimeSpanRelative time after which to execute the action.
action
Func<IScheduler, TState, IDisposable>Action to be executed.
Returns
- IDisposable
The disposable object used to cancel the scheduled action (best effort).
Type Parameters
TState
The type of the state passed to the scheduled action.