Skip to content
ConsoleMonster

API Reference

Class

StatusEnumPresenter

Namespace ConsoleMonster.Presenters
Assembly ConsoleMonster
Implements
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.

Inheritance

  • Object
  • StatusEnumPresenter

Constructors

public StatusEnumPresenter() #

Methods

public static Boolean LooksLikeStatus(Type type) #
Returns: Boolean

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

Parameters

type System.Type requiredposition: 0
The enum type.

Returns

True when it looks like a status.

public PresentedValue Present(Object? value, PresenterContext context) #
Returns: PresentedValue

Presents a value.

Parameters

value System.Object? requiredposition: 0
The raw value (may be null).
context ConsoleMonster.Presenters.PresenterContext requiredposition: 1
Culture, clock, time zone, column statistics and the render context.

Returns

The presented value.

public static Boolean TryRead(String? word, out StatusKind status) #
Returns: Boolean

Whether a word reads as a status.

Parameters

word System.String? requiredposition: 0
The word (an enum name or text).
status ConsoleMonster.Styling.StatusKind requiredposition: 1
The status it reads as.

Returns

True when known.