Skip to content
ConsoleMonster
Class

StatusEnumPresenter

ConsoleMonster.Presenters

Namespace
ConsoleMonster.Presenters
Assembly
ConsoleMonster
Implements
ICellPresenter
Modifiers
sealed

Enum and text values that read as a status (Running, Stopped, Healthy, Failed, Degraded...) shown with a status marker and colour, keeping the value's own word: ● Running, ○ Stopped, ✗ Failed. Words it does not know show as plain text. Word markers replace recognized status words instead of repeating them.

Inheritance

  • object
  • StatusEnumPresenter

Constructors

public StatusEnumPresenter() #

Methods

public static bool LooksLikeStatus(Type type) #

Whether an enum type reads as a status: at least one of its names is a known status word.

Parameters

type System.Type required
The enum type.

Returns

bool True when it looks like a status.
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.
public static bool TryRead(string? word, out StatusKind status) #

Whether a word reads as a status.

Parameters

word string? required
The word (an enum name or text).
status ConsoleMonster.Styling.StatusKind required
The status it reads as.

Returns

bool True when known.