Skip to content
ConsoleMonster

API Reference

Class

TextAreaPrompt

Namespace ConsoleMonster.Interactive
Assembly ConsoleMonster
Base Prompt<String>
Modifiers sealed

Several lines of text, for notes and change reasons: soft wrap, Enter for a new line, Ctrl+Enter (or Ctrl+S) to save, paste with line breaks kept, a line and length limit, required/minimum checks and a validator with an inline error, and a counter. In line mode the answer is read line by line until an empty line.

Inheritance

  • Prompt<String>
  • TextAreaPrompt

Constructors

public TextAreaPrompt(String title) #

Creates the prompt.

Parameters

title System.String requiredposition: 0
The question.

Methods

public override String Describe(String value) #
Returns: String

The answer as text, for the summary line left in the scrollback.

Parameters

value System.String requiredposition: 0
The answer.

Returns

The text.

Properties

public String? Placeholder { get; set; } #

Muted text in the empty box.

public Boolean Required { get; set; } #

Whether an empty answer is refused.

public Int32 MinLength { get; set; } #

The fewest characters accepted.

public Int32 MaxLength { get; set; } #

The most characters the box takes.

public Int32 MaxLines { get; set; } #

The most lines the box takes.

public Int32 Height { get; set; } #

The visible rows (default 6); longer text scrolls.

public Func<String, String?>? Validator { get; set; } #

A validator: returns an error message, or null when the answer is fine.