Table of Contents

Struct TigerTuiResult<T>

Namespace
ItTiger.TigerCli.Tui
Assembly
ItTiger.TigerCli.dll
The rich outcome of a TigerCli modal prompt: the exact DialogResultKind the modal loop reported, plus the produced Value (meaningful only when the prompt completed with Ok).
public readonly record struct TigerTuiResult<T> : IEquatable<TigerTuiResult<T>>

Type Parameters

T
Implements
Inherited Members

Remarks

This is the framework-internal primitive. TigerCli internals branch on ResultKind so they can tell the cancellation flavours apart (e.g. Cancel vs TokenCancel vs Timeout). The simple TigerTui helpers are adapters over this type and collapse it at the outer edge (e.g. to value-or-null), preserving their established observable behavior.

Constructors

TigerTuiResult(DialogResultKind, T?)

Creates a prompt result with its exact dialog outcome and optional value.
public TigerTuiResult(DialogResultKind resultKind, T? value = default)

Parameters

resultKind DialogResultKind
The dialog result reported by the modal loop.
value T
The value produced by a successful prompt.

Properties

IsOk

True when the prompt completed successfully (Ok).
public bool IsOk { get; }

Property Value

bool

ResultKind

The exact dialog result kind reported by the modal loop.
public DialogResultKind ResultKind { get; }

Property Value

DialogResultKind

Value

The produced value; only meaningful when IsOk is true.
public T? Value { get; }

Property Value

T

Methods

FromKind(DialogResultKind)

A non-success result carrying only the kind (no value).
public static TigerTuiResult<T> FromKind(DialogResultKind kind)

Parameters

kind DialogResultKind

Returns

TigerTuiResult<T>

Ok(T?)

A successful result carrying value.
public static TigerTuiResult<T> Ok(T? value)

Parameters

value T

Returns

TigerTuiResult<T>

TryGetValue(out T?)

Returns the value via value when IsOk; otherwise the default.
public bool TryGetValue(out T? value)

Parameters

value T

Returns

bool