Table of Contents

Interface ITerminalCommandStore

Namespace
OneImlx.Terminal.Stores
Assembly
OneImlx.Terminal.dll

A store of CommandDescriptor.

public interface ITerminalCommandStore

Methods

AllAsync()

Returns all CommandDescriptor asynchronously.

Task<CommandDescriptors> AllAsync()

Returns

Task<CommandDescriptors>

A Dictionary<TKey, TValue> of command descriptors.

TryAddAsync(string, CommandDescriptor)

Adds a CommandDescriptor to the store.

Task<bool> TryAddAsync(string id, CommandDescriptor commandDescriptor)

Parameters

id string

The command id.

commandDescriptor CommandDescriptor

The command descriptor to add.

Returns

Task<bool>

true if added, false otherwise.

TryFindByIdAsync(string, out CommandDescriptor?)

Attempts to finds a CommandDescriptor by its id asynchronously.

Task<bool> TryFindByIdAsync(string id, out CommandDescriptor? commandDescriptor)

Parameters

id string

The command id.

commandDescriptor CommandDescriptor

The CommandDescriptor if found, otherwise null

Returns

Task<bool>

Remarks

This method should never throw an exception. If the command is not found then return false.