Skip to content
ConsoleMonster

API Reference

Class

ConsoleLineConsole

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Implements
Modifiers sealed

The ILineConsole over Console: standard input and output.

Inheritance

  • Object
  • ConsoleLineConsole

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

Constructors

public ConsoleLineConsole() #

Methods

public 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 String? ReadLine() #
Returns: String?

Reads a line; null when the input ended.

Returns

The line.

public String? ReadSecret() #
Returns: String?

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

Returns

The secret.

public 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 Void WriteLine(String text) #
Returns: Void

Writes a line.

Parameters

text System.String requiredposition: 0
The text.

Properties

public static ConsoleLineConsole Instance { get; } #

The shared instance.