Class Runnable<TResult>
Base implementation of IRunnable<TResult> for views that can be run as blocking sessions.
public class Runnable<TResult> : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IRunnable<TResult>, IRunnable
Type Parameters
TResultThe type of result data returned when the session completes.
- Inheritance
-
Runnable<TResult>
- Implements
-
IRunnable<TResult>
- Derived
- Inherited Members
- Extension Methods
Remarks
Views can derive from this class or implement IRunnable<TResult> directly.
This class provides default implementations of the IRunnable<TResult> interface following the Terminal.Gui Cancellable Work Pattern (CWP).
Properties
- IsModal
Gets whether this runnable session is at the top of the RunnableSessionStack and thus exclusively receiving mouse and keyboard input.
- IsRunning
Gets whether this runnable session is currently running (i.e., on the RunnableSessionStack).
- Result
Gets or sets the result data extracted when the session was accepted, or null if not accepted.
Methods
- OnIsModalChanged(bool)
Called after IsModal has changed. Override for post-activation logic.
- OnIsModalChanging(bool, bool)
Called before IsModalChanging event. Override to cancel activation/deactivation.
- OnIsRunningChanged(bool)
Called after IsRunning has changed. Override for post-state-change logic.
- OnIsRunningChanging(bool, bool)
Called before IsRunningChanging event. Override to cancel state change or extract Result.
- RaiseIsModalChangedEvent(bool)
Called by the framework to raise the IsModalChanged event.
- RaiseIsModalChanging(bool, bool)
Called by the framework to raise the IsModalChanging event.
- RaiseIsRunningChangedEvent(bool)
Called by the framework to raise the IsRunningChanged event.
- RaiseIsRunningChanging(bool, bool)
Called by the framework to raise the IsRunningChanging event.
- RequestStop()
Requests that this runnable session stop.
Events
- IsModalChanged
Raised after this runnable has become modal (top of stack) or ceased being modal.
- IsModalChanging
Raised when this runnable is about to become modal (top of stack) or cease being modal. Can be canceled by setting CancelEventArgs<T>.Cancel to true.
- IsRunningChanged
Raised after IsRunning has changed (after the runnable has been added to or removed from the RunnableSessionStack).
- IsRunningChanging
Raised when IsRunning is changing (e.g., when Begin(IRunnable) or End(RunnableSessionToken) is called). Can be canceled by setting CancelEventArgs<T>.Cancel to true.