Skip to content
ConsoleMonster

API Reference

Interface

ILineConsole

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Modifiers abstract

Line-based input and output for InteractionMode.Line and InteractionMode.Accessible prompts: the console by default, or a PowerShell host (Host.UI.ReadLine, PromptForChoice) in remoting and the ISE.

Usage

Explore 1 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 1

Methods

public abstract Int32? Choose(String caption, String message, IReadOnlyList<String> choices, Int32 defaultIndex) #
Returns: Int32?

Lets the host ask a choice question natively (PowerShell's PromptForChoice). Return null to fall back to a numbered list.

Parameters

caption System.String requiredposition: 0
The question.
message System.String requiredposition: 1
Extra text, or empty.
choices System.Collections.Generic.IReadOnlyList<System.String> requiredposition: 2
The choice labels.
defaultIndex System.Int32 requiredposition: 3
The default choice, or -1.

Returns

The chosen index, or null when not supported.

public abstract String? ReadLine() #
Returns: String?

Reads a line; null when the input ended.

Returns

The line.

public abstract String? ReadSecret() #
Returns: String?

Reads a line without echoing it; null when the input ended.

Returns

The secret.

public abstract Void Write(String text) #
Returns: Void

Writes text without ending the line (the question before an answer).

Parameters

text System.String requiredposition: 0
The text.
public abstract Void WriteLine(String text) #
Returns: Void

Writes a line.

Parameters

text System.String requiredposition: 0
The text.