Skip to content
ConsoleMonster
Class

BooleanPresenter

ConsoleMonster.Presenters

Namespace
ConsoleMonster.Presenters
Assembly
ConsoleMonster
Implements
ICellPresenter
Modifiers
sealed

A boolean as symbol and word: ✓ yes / – no (yes / no on the ASCII tier). True takes the pass tone and false is muted, unless the presenter is created as a problem flag (true is bad).

Inheritance

  • object
  • BooleanPresenter

Constructors

public BooleanPresenter(string trueText = "yes", string falseText = "no", bool trueIsProblem = false) #

Creates a boolean presenter.

Parameters

trueText string = "yes" optional
The word for true (default yes).
falseText string = "no" optional
The word for false (default no).
trueIsProblem bool = false optional
Whether true is a problem (for example PasswordNeverExpires): true takes the warning tone.

Methods

public PresentedValue Present(object? value, PresenterContext context) #

Presents a value.

Parameters

value object? required
The raw value (may be null).
context ConsoleMonster.Presenters.PresenterContext required
Culture, clock, time zone, column statistics and the render context.

Returns

PresentedValue The presented value.

Properties

public string TrueText { get; } #

The word for true.

public string FalseText { get; } #

The word for false.

public bool TrueIsProblem { get; } #

Whether true is a problem.