Interface IConsoleHandler
Inherited Members
System.IDisposable.Dispose()
Namespace: Experior.Interfaces.Console
Assembly: Experior.Interfaces.dll
Syntax
public interface IConsoleHandler : IDisposable
Properties
CommandInputEnabled
Turn command input on or off
Declaration
bool CommandInputEnabled { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Commands
List of added commands
Declaration
IReadOnlyList<IConsoleCommand> Commands { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<IConsoleCommand> |
ConsoleAttached
Indication of whether console is attached
Declaration
bool ConsoleAttached { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
AddCommand(IConsoleCommand)
Add command handler
Declaration
bool AddCommand(IConsoleCommand command)
Parameters
Type | Name | Description |
---|---|---|
IConsoleCommand | command | Command instance |
Returns
Type | Description |
---|---|
System.Boolean |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | If Command match is not unique |
AttachOrAllocConsole()
Declaration
bool AttachOrAllocConsole()
Returns
Type | Description |
---|---|
System.Boolean |
DetachConsole(Boolean)
Detaches the calling process from its console.
Declaration
void DetachConsole(bool sendKeyStroke = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | sendKeyStroke |
HideConsole()
Declaration
void HideConsole()
PrintConsoleCommands()
Print list of all added commands
Declaration
void PrintConsoleCommands()
ReadKey(Boolean)
Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window.
Declaration
void ReadKey(bool intercept)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | intercept | Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The System.Console.In property is redirected from some stream other than the console. |
ShowConsole()
Declaration
void ShowConsole()
Spin(String, Int32)
Declaration
void Spin(string text, int percent)
Parameters
Type | Name | Description |
---|---|---|
System.String | text | |
System.Int32 | percent |
Write(String, LogFilter)
Writes the specified string value to the standard output stream.
Declaration
void Write(string value, LogFilter filter)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | The value to write. |
LogFilter | filter | LogFilter. |
Exceptions
Type | Condition |
---|---|
System.IO.IOException | An I/O error occurred. |