Class
StatusEnumPresenter
ConsoleMonster.Presenters
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
- 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?
- The raw value (may be null).
- context ConsoleMonster.Presenters.PresenterContext
- Culture, clock, time zone, column statistics and the render context.
public static bool TryRead(string? word, out StatusKind status) #Whether a word reads as a status.
Parameters
- word string?
- The word (an enum name or text).
- status ConsoleMonster.Styling.StatusKind
- The status it reads as.
Returns
bool True when known.