Table of Contents

Method AddTimeout

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

AddTimeout(TimeSpan, Func<bool>)

Adds a timeout to the application.

object AddTimeout(TimeSpan time, Func<bool> callback)

Parameters

time TimeSpan

The time span to wait before invoking the callback.

callback Func<bool>

The callback to invoke. If it returns true, the timeout will be reset and repeat. If it returns false, the timeout will stop and be removed.

Returns

object

Call RemoveTimeout(object) with the returned value to stop the timeout.

Remarks

When the time specified passes, the callback will be invoked on the main UI thread.

Shutdown() calls StopAll on TimedEvents to remove all timeouts.