Class DispatcherScheduledAction
- Namespace
- CarinaStudio.Threading
- Assembly
- CarinaStudio.AppBase.Avalonia.dll
ScheduledAction which schedules the action with specific Avalonia.Threading.DispatcherPriority.
public class DispatcherScheduledAction : ScheduledAction, ISynchronizable
- Inheritance
-
DispatcherScheduledAction
- Implements
- Inherited Members
- Extension Methods
Constructors
DispatcherScheduledAction(DispatcherSynchronizationContext, Action)
Initialize new DispatcherScheduledAction instance with Avalonia.Threading.DispatcherPriority.Default priority.
public DispatcherScheduledAction(DispatcherSynchronizationContext synchronizationContext, Action action)
Parameters
synchronizationContextDispatcherSynchronizationContextDispatcherSynchronizationContext to perform action.
actionActionAction.
DispatcherScheduledAction(DispatcherSynchronizationContext, Action, DispatcherPriority)
Initialize new DispatcherScheduledAction instance.
public DispatcherScheduledAction(DispatcherSynchronizationContext synchronizationContext, Action action, DispatcherPriority priority)
Parameters
synchronizationContextDispatcherSynchronizationContextDispatcherSynchronizationContext to perform action.
actionActionAction.
priorityDispatcherPriorityPriority.
DispatcherScheduledAction(ISynchronizable, Action)
Initialize new DispatcherScheduledAction instance with Avalonia.Threading.DispatcherPriority.Default priority.
public DispatcherScheduledAction(ISynchronizable synchronizable, Action action)
Parameters
synchronizableISynchronizableISynchronizable to provide DispatcherSynchronizationContext to perform action.
actionActionAction.
DispatcherScheduledAction(ISynchronizable, Action, DispatcherPriority)
Initialize new DispatcherScheduledAction instance.
public DispatcherScheduledAction(ISynchronizable synchronizable, Action action, DispatcherPriority priority)
Parameters
synchronizableISynchronizableISynchronizable to provide DispatcherSynchronizationContext to perform action.
actionActionAction.
priorityDispatcherPriorityPriority.
Methods
CancelAction(object)
Cancel posted action.
protected override bool CancelAction(object token)
Parameters
tokenobjectToken returned from PostAction(SendOrPostCallback, object?, int) to identify the posted action.
Returns
- bool
True if action has been cancelled successfully.
PostAction(SendOrPostCallback, object?, int)
Post action to underlying synchronization context.
protected override object PostAction(SendOrPostCallback action, object? state, int delayMillis)
Parameters
actionSendOrPostCallbackAction.
stateobjectState.
delayMillisintDelay time in milliseconds.
Returns
- object
Token to identify the posted action.