Table of Contents

Method Begin

Namespace
Terminal.Gui.App
Assembly
Terminal.Gui.dll

Begin(Toplevel)

Building block API: Creates a SessionToken and prepares the provided Toplevel for execution. Not usually called directly by applications. Use Run(Toplevel, Func<Exception, bool>?) instead.

public SessionToken Begin(Toplevel toplevel)

Parameters

toplevel Toplevel

The Toplevel to prepare execution for.

Returns

SessionToken

The SessionToken that needs to be passed to the End(SessionToken) method upon completion.

Remarks

This method prepares the provided Toplevel for running. It adds this to the list of Toplevels, lays out the SubViews, focuses the first element, and draws the Toplevel on the screen. This is usually followed by starting the main loop, and then the End(SessionToken) method upon termination which will undo these changes.

Raises the SessionBegun event before returning.

Begin(IRunnable)

Building block API: Creates a RunnableSessionToken and prepares the provided IRunnable for execution. Not usually called directly by applications. Use Run(IRunnable, Func<Exception, bool>?) instead.

public RunnableSessionToken Begin(IRunnable runnable)

Parameters

runnable IRunnable

The IRunnable to prepare execution for.

Returns

RunnableSessionToken

The RunnableSessionToken that needs to be passed to the End(RunnableSessionToken) method upon completion.

Remarks

This method prepares the provided IRunnable for running. It adds this to the RunnableSessionStack, lays out the SubViews, focuses the first element, and draws the runnable on the screen. This is usually followed by starting the main loop, and then the End(RunnableSessionToken) method upon termination which will undo these changes.

Raises the IsRunningChanging, IsRunningChanged, IsModalChanging, and IsModalChanged events.