StatusKinds
ConsoleMonster.Styling
Helpers for StatusKind: theme token mapping and lenient parsing.
Inheritance
- object
- StatusKinds
Methods
public static string ToEnglishWord(StatusKind status) #The English status word (PASS, FAIL...), for logs and machine-read output.
Parameters
- status ConsoleMonster.Styling.StatusKind
- The status.
Returns
string The word.public static ThemeToken ToToken(StatusKind status) #Returns the theme token that colours a status.
Parameters
- status ConsoleMonster.Styling.StatusKind
- The status.
public static string ToWord(StatusKind status) #A short upper-case status word using session-scoped labels, then the active profile's language, then WidgetLabels.Current.
Parameters
- status ConsoleMonster.Styling.StatusKind
- The status.
Returns
string The word.public static string ToWord(StatusKind status, RenderContext context) #A status word in the render context's language.
Parameters
- status ConsoleMonster.Styling.StatusKind
- The status.
- context ConsoleMonster.Canvas.RenderContext
- The rendering context.
Returns
string The localized word.public static string ToWord(StatusKind status, TerminalProfile profile) #A status word in the profile's language, or the current fallback labels when no language is set.
Parameters
- status ConsoleMonster.Styling.StatusKind
- The status.
- profile ConsoleMonster.Capabilities.TerminalProfile
- The rendering profile.
Returns
string The localized word.public static bool TryParse(string? text, out StatusKind status) #Parses a status word leniently, including PowerShell's own words: pass/passed/ok/success/done/completed, fail/failed/failure, warn/warning, skip/skipped/na, run/running/active/busy, pending/queued/waiting, info/information/verbose/debug, error/errored, investigate/review and notrun/not run/notexecuted.
Parameters
- text string?
- The word.
- status ConsoleMonster.Styling.StatusKind
- The status.
Returns
bool Whether the word was recognised.Inherited Methods
Properties
public static IReadOnlyList<string> Words { get; } #The words StatusKinds.TryParse accepts, for argument completion: the canonical names first, then PowerShell's words.