Table of Contents

Class OptionDescriptors

Namespace
OneImlx.Terminal.Commands
Assembly
OneImlx.Terminal.dll

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 ITerminalTextHandler

The text handler.

collection IEnumerable<OptionDescriptor>

The option descriptors.

Properties

Count

public int Count { get; }

Property Value

int

this[string]

Gets an OptionDescriptor instance with the specified id or alias.

public OptionDescriptor this[string idOrAlias] { get; }

Parameters

idOrAlias string

The 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

IEnumerable<string>

TextHandler

The text handler.

public ITerminalTextHandler TextHandler { get; }

Property Value

ITerminalTextHandler

Values

public IEnumerable<OptionDescriptor> Values { get; }

Property Value

IEnumerable<OptionDescriptor>

Methods

ContainsKey(string)

public bool ContainsKey(string key)

Parameters

key string

Returns

bool

GetEnumerator()

public IEnumerator GetEnumerator()

Returns

IEnumerator

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 string
value OptionDescriptor

Returns

bool