Class TigerCliProviderContext
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
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
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
namestring- 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
namestring- Alias token, normalized alias, or property name; must not be null/whitespace.
valueTValue- The typed value when found; otherwise
default.
Returns
Type Parameters
TValue
Exceptions
- ArgumentException
nameis null, empty, or whitespace.