Class OptionDescriptors
The OptionDescriptor collection.
public sealed class OptionDescriptors : IReadOnlyDictionary<string, OptionDescriptor>, IReadOnlyCollection<KeyValuePair<string, OptionDescriptor>>, IEnumerable<KeyValuePair<string, OptionDescriptor>>, IEnumerable
- Inheritance
-
OptionDescriptors
- Implements
- Inherited Members
Constructors
OptionDescriptors(ITerminalTextHandler, IEnumerable<OptionDescriptor>?)
Initializes a new instance with the specified option descriptors.
public OptionDescriptors(ITerminalTextHandler textHandler, IEnumerable<OptionDescriptor>? collection = null)
Parameters
textHandler
ITerminalTextHandlerThe text handler.
collection
IEnumerable<OptionDescriptor>The option descriptors.
Properties
Count
public int Count { get; }
Property Value
this[string]
Gets an OptionDescriptor instance with the specified id or alias.
public OptionDescriptor this[string idOrAlias] { get; }
Parameters
idOrAlias
stringThe option id or its alias.
Property Value
- OptionDescriptor
OptionDescriptor instance if found.
Exceptions
- TerminalException
If OptionDescriptor instance with specified id is not found.
Keys
public IEnumerable<string> Keys { get; }
Property Value
TextHandler
The text handler.
public ITerminalTextHandler TextHandler { get; }
Property Value
Values
public IEnumerable<OptionDescriptor> Values { get; }
Property Value
Methods
ContainsKey(string)
public bool ContainsKey(string key)
Parameters
key
string
Returns
GetEnumerator()
public IEnumerator GetEnumerator()
Returns
RegisterHelp(OptionDescriptor)
Registers the help option.
public void RegisterHelp(OptionDescriptor helpDescriptor)
Parameters
helpDescriptor
OptionDescriptor
TryGetValue(string, out OptionDescriptor)
public bool TryGetValue(string key, out OptionDescriptor value)
Parameters
key
stringvalue
OptionDescriptor