Table of Contents

Interface IConsole

Namespace
McMaster.Extensions.CommandLineUtils
Assembly
McMaster.Extensions.CommandLineUtils.dll

An abstract console.

public interface IConsole
Extension Methods

Properties

BackgroundColor

The background color of output.

ConsoleColor BackgroundColor { get; set; }

Property Value

ConsoleColor

Error

stderr

TextWriter Error { get; }

Property Value

TextWriter

ForegroundColor

The foreground color of output.

ConsoleColor ForegroundColor { get; set; }

Property Value

ConsoleColor

In

stdin

TextReader In { get; }

Property Value

TextReader

IsErrorRedirected

Is stderr being piped to somewhere?

bool IsErrorRedirected { get; }

Property Value

bool

IsInputRedirected

Is stdin piped from somewhere?

bool IsInputRedirected { get; }

Property Value

bool

IsOutputRedirected

Is stdout being piped to somewhere?

bool IsOutputRedirected { get; }

Property Value

bool

Out

stdout

TextWriter Out { get; }

Property Value

TextWriter

Methods

ResetColor()

void ResetColor()

Events

CancelKeyPress

Raised when Ctrl+C is pressed.

event ConsoleCancelEventHandler? CancelKeyPress

Event Type

ConsoleCancelEventHandler