IConsole Interface
Abstracts the system console for HAKOM applications, extending System.CommandLine.IConsole with encoding and window-dimension members.
public interface IConsole : System.CommandLine.IConsole, System.CommandLine.IO.IStandardOut, System.CommandLine.IO.IStandardError, System.CommandLine.IO.IStandardInImplements System.CommandLine.IConsole, System.CommandLine.IO.IStandardOut, System.CommandLine.IO.IStandardError, System.CommandLine.IO.IStandardIn
Remarks
Section titled “Remarks”Inject IConsole into commands and services instead of referencing System.Console directly so that output and input can be redirected or captured in unit tests.
The production implementation is registered by UseConsole(this IContainer). A test-friendly singleton that wraps explicit System.IO.TextWriter and System.IO.TextReader instances is registered by the three-argument overload.
Properties
Section titled “Properties”IConsole.Error Property
Section titled “IConsole.Error Property”Gets the System.IO.TextWriter used for standard error output.
System.IO.TextWriter Error { get; }Implements Error
Property Value
Section titled “Property Value”IConsole.In Property
Section titled “IConsole.In Property”Gets the System.IO.TextReader used for standard input.
System.IO.TextReader In { get; }Property Value
Section titled “Property Value”IConsole.InputEncoding Property
Section titled “IConsole.InputEncoding Property”Gets the character encoding used when reading from In.
System.Text.Encoding InputEncoding { get; }Property Value
Section titled “Property Value”IConsole.Out Property
Section titled “IConsole.Out Property”Gets the System.IO.TextWriter used for standard output.
System.IO.TextWriter Out { get; }Implements Out
Property Value
Section titled “Property Value”IConsole.OutputEncoding Property
Section titled “IConsole.OutputEncoding Property”Gets the character encoding used when writing to Out.
System.Text.Encoding OutputEncoding { get; }Property Value
Section titled “Property Value”IConsole.WindowHeight Property
Section titled “IConsole.WindowHeight Property”Gets the height of the console window, in character rows.
int WindowHeight { get; }Property Value
Section titled “Property Value”IConsole.WindowWidth Property
Section titled “IConsole.WindowWidth Property”Gets the width of the console window, in characters.
int WindowWidth { get; }