Class TigerCliProviderConfiguration
Registers app-level named dynamic value providers, configured through
TigerCliAppBuilder.ConfigureProviders(...). A provider is referenced by key from
Provider / Provider
(or matched implicitly by property name for options) and supplies the choices used by
provider-backed prompting and by validation of supplied values. String providers use each
string as both value and label; named providers return key/label pairs. On every overload the
optional dependsOn names values that should be resolved first, and the trailing
configure callback receives a TigerCliProviderOptions for provider-specific
framework text (loading message, empty message) — omit it for generic localized defaults.public sealed class TigerCliProviderConfiguration
- Inheritance
-
TigerCliProviderConfiguration
- Inherited Members
Methods
Add(string, Func<TigerCliProviderContext, IReadOnlyList<string>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers a sync app-level string provider; each returned string is used as both value and
label. Prefer the async overloads for slow or I/O-backed providers.
public void Add(string key, Func<TigerCliProviderContext, IReadOnlyList<string>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)
Parameters
keystringproviderFunc<TigerCliProviderContext, IReadOnlyList<string>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Exceptions
- ArgumentException
keyis null, empty, or whitespace.- ArgumentNullException
providerisnull.
Add(string, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers an async app-level string provider; each returned string is used as both value
and label. Equivalent to AddAsync(string, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?),
which is the preferred spelling for new code.
public void Add(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)
Parameters
keystringproviderFunc<TigerCliProviderContext, Task<IReadOnlyList<string>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Exceptions
- ArgumentException
keyis null, empty, or whitespace.- ArgumentNullException
providerisnull.
AddAsync(string, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers an async app-level string provider. Prefer this over the sync Add(string, Func<TigerCliProviderContext, IReadOnlyList<string>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
for slow or I/O-backed providers; observe CancellationToken
to make the work cooperatively cancellable, and use
configure to customize the
loading message.public void AddAsync(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<string>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)
Parameters
keystringproviderFunc<TigerCliProviderContext, Task<IReadOnlyList<string>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
AddAsync<TValue>(string, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers an async app-level named provider. Prefer this over the sync overload for slow or
I/O-backed providers; observe CancellationToken to make the
work cooperatively cancellable, and use
configure to customize the loading
message.public void AddAsync<TValue>(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)
Parameters
keystringproviderFunc<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Type Parameters
TValue
AddAsync<TSettings, TValue>(string, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers an async app-level named provider that can read partially bound settings. Prefer this
over the sync overload for slow or I/O-backed providers; observe
CancellationToken to make the work cooperatively cancellable,
and use
configure to customize the loading message.public void AddAsync<TSettings, TValue>(string key, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null) where TSettings : TigerCliSettings
Parameters
keystringproviderFunc<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Type Parameters
TSettingsTValue
Add<TValue>(string, Func<TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers a sync app-level named provider returning key/label pairs
(OptionItem<TKey>). Prefer the async overloads for slow or I/O-backed
providers.
public void Add<TValue>(string key, Func<TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)
Parameters
keystringproviderFunc<TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Type Parameters
TValue
Exceptions
- ArgumentException
keyis null, empty, or whitespace.- ArgumentNullException
providerisnull.
Add<TValue>(string, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers an async app-level named provider returning key/label pairs
(OptionItem<TKey>). The key is the bound value; the label is display text.
Equivalent to the
AddAsync spelling, which is preferred for new code.public void Add<TValue>(string key, Func<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null)
Parameters
keystringproviderFunc<TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Type Parameters
TValue
Exceptions
- ArgumentException
keyis null, empty, or whitespace.- ArgumentNullException
providerisnull.
Add<TSettings, TValue>(string, Func<TSettings, TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers a sync app-level named provider that additionally receives the partially bound
settings instance. Prefer the async overloads for slow or I/O-backed providers.
public void Add<TSettings, TValue>(string key, Func<TSettings, TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null) where TSettings : TigerCliSettings
Parameters
keystringproviderFunc<TSettings, TigerCliProviderContext, IReadOnlyList<OptionItem<TValue>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Type Parameters
TSettingsTValue
Exceptions
- ArgumentException
keyis null, empty, or whitespace.- ArgumentNullException
providerisnull.
Add<TSettings, TValue>(string, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>, IEnumerable<string>?, Action<TigerCliProviderOptions>?)
Registers an async app-level named provider that additionally receives the partially bound
settings instance, letting the choices depend on values supplied earlier in the run.
Equivalent to the
AddAsync spelling, which is preferred for new code.public void Add<TSettings, TValue>(string key, Func<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>> provider, IEnumerable<string>? dependsOn = null, Action<TigerCliProviderOptions>? configure = null) where TSettings : TigerCliSettings
Parameters
keystringproviderFunc<TSettings, TigerCliProviderContext, Task<IReadOnlyList<OptionItem<TValue>>>>dependsOnIEnumerable<string>configureAction<TigerCliProviderOptions>
Type Parameters
TSettingsTValue
Exceptions
- ArgumentException
keyis null, empty, or whitespace.- ArgumentNullException
providerisnull.