Table of Contents

Class Runnable

Namespace
Terminal.Gui.Views
Assembly
Terminal.Gui.dll

Base implementation of IRunnable for views that can be run as blocking sessions without returning a result.

public class Runnable : View, IDisposable, ISupportInitializeNotification, ISupportInitialize, IRunnable
Inheritance
Runnable
Implements
Derived
Runnable<TResult>
Inherited Members
Extension Methods

Remarks

Views that don't need to return a result can derive from this class instead of Runnable<TResult>.

This class provides default implementations of the IRunnable interface following the Terminal.Gui Cancellable Work Pattern (CWP).

For views that need to return a result, use Runnable<TResult> instead.

Constructors

Runnable()

Constructs a new instance of the Runnable class.

Properties

IsModal

Gets whether this runnable session is at the top of the SessionStack and thus exclusively receiving mouse and keyboard input.

IsRunning

Gets whether this runnable session is currently running (i.e., on the SessionStack).

Result

Gets or sets the result data extracted when the session was accepted, or null if not accepted.

StopRequested

Gets or sets whether a stop has been requested for this runnable session.

Methods

OnIsModalChanged(bool)

Called after IsModal has changed. Override for post-activation logic.

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 perform cleanup.

RaiseIsModalChangedEvent(bool)

Called by the framework to raise the IsModalChanged 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.

SetApp(IApplication)

Sets the application context for this runnable. Called from Begin(IRunnable).

SetIsModal(bool)

Sets the cached IsModal state. Called by ApplicationImpl within the session stack lock. This method is internal to the framework and should not be called by application code.

SetIsRunning(bool)

Sets the cached IsRunning state. Called by ApplicationImpl within the session stack lock. This method is internal to the framework and should not be called by application code.

Events

IsModalChanged

Raised after this runnable has become modal (top of stack) or ceased being modal.

IsRunningChanged

Raised after IsRunning has changed (after the runnable has been added to or removed from the SessionStack).

IsRunningChanging

Raised when IsRunning is changing (e.g., when Begin(IRunnable) or End(SessionToken) is called). Can be canceled by setting args.Cancel to true.