Class Options
The ordered Option keyed collection.
public sealed class Options : IReadOnlyDictionary<string, Option>, IReadOnlyCollection<KeyValuePair<string, Option>>, IEnumerable<KeyValuePair<string, Option>>, IEnumerable
- Inheritance
-
Options
- Implements
- Inherited Members
Constructors
Options(ITerminalTextHandler, IEnumerable<Option>?)
Initializes a new instance.
public Options(ITerminalTextHandler textHandler, IEnumerable<Option>? options = null)
Parameters
textHandler
ITerminalTextHandlerThe text handler.
options
IEnumerable<Option>The options.
Properties
Count
public int Count { get; }
Property Value
this[string]
public Option this[string key] { get; }
Parameters
key
string
Property Value
Keys
public IEnumerable<string> Keys { get; }
Property Value
TextHandler
The text handler.
public ITerminalTextHandler TextHandler { get; }
Property Value
Values
public IEnumerable<Option> Values { get; }
Property Value
Methods
ContainsKey(string)
public bool ContainsKey(string key)
Parameters
key
string
Returns
GetEnumerator()
public IEnumerator<KeyValuePair<string, Option>> GetEnumerator()
Returns
GetOptionValue<TValue>(string)
Gets the option value by its id.
public TValue GetOptionValue<TValue>(string optId)
Parameters
optId
stringThe option identifier or the alias.
Returns
- TValue
Type Parameters
TValue
TryGetValue(string, out Option)
public bool TryGetValue(string key, out Option value)