Table of Contents

Class TigerCliProviderContext

Namespace
ItTiger.TigerCli.Commands
Assembly
ItTiger.TigerCli.dll
Run-time context passed to dynamic value-provider callbacks. Exposes the effective cancellation token, the active run culture, and read access to option values that were already bound or prompted earlier in the run (declare ordering with the registration's dependsOn hint).
public sealed class TigerCliProviderContext
Inheritance
TigerCliProviderContext
Inherited Members

Properties

CancellationToken

The effective run/prompt cancellation token threaded from the pipeline. Observing it is optional and cooperative: a provider that throws OperationCanceledException while this token is cancelled is treated as a cancellation — prompt-backed providers map to the standard prompt-cancellation outcome, validation-time providers propagate the cancellation — never as a provider failure.
public CancellationToken CancellationToken { get; }

Property Value

CancellationToken

Culture

The active run culture as resolved by the framework. Provider callbacks can use this to return localized labels without mutating CurrentUICulture.
public CultureInfo Culture { get; }

Property Value

CultureInfo

Methods

GetOptionValue<TValue>(string)

Returns an already-bound or already-prompted option value when available and assignable to TValue; otherwise default. Convenience form of TryGetValue<TValue>(string, out TValue?).
public TValue? GetOptionValue<TValue>(string name)

Parameters

name string
Alias token, normalized alias, or property name; must not be null/whitespace.

Returns

TValue

Type Parameters

TValue

TryGetValue<TValue>(string, out TValue?)

Reads an already-bound or already-prompted option value. name may be an alias token (--env), a normalized alias (env), or the settings property name. Returns false when the value is not available yet or is not assignable to TValue.
public bool TryGetValue<TValue>(string name, out TValue? value)

Parameters

name string
Alias token, normalized alias, or property name; must not be null/whitespace.
value TValue
The typed value when found; otherwise default.

Returns

bool

Type Parameters

TValue

Exceptions

ArgumentException
name is null, empty, or whitespace.