Table of Contents

Class TigerCustomStyleRegistry

Namespace
ItTiger.TigerCli.Tui.Themes
Assembly
ItTiger.TigerCli.dll
App-scoped registry of custom semantic styles (see CliCustomStyle). Custom styles extend the curated framework semantic tokens with app-defined roles such as ConnectionName or EnvironmentProd; they resolve through the active theme and are used as single-token markup tags.

Instances are app-local: construct one per app/test, configure it, then make it active via TigerConsole.CustomStyles so the markup call sites resolve custom tokens. Nothing is process-global.

public sealed class TigerCustomStyleRegistry
Inheritance
TigerCustomStyleRegistry
Inherited Members

Properties

IsEmpty

True when no custom styles are registered.
public bool IsEmpty { get; }

Property Value

bool

Names

The registered custom style names (case-insensitive). Snapshot.
public IReadOnlyCollection<string> Names { get; }

Property Value

IReadOnlyCollection<string>

Methods

Contains(string)

True when a custom style with this name is registered (case-insensitive).
public bool Contains(string name)

Parameters

name string

Returns

bool

Register(string, ThemeStyle, CliCellStyle?, CliCellStyle?)

Registers (or replaces) a custom style. baseStyle is the required framework fallback; darkStyle/lightStyle are optional family overrides. Re-registering the same name replaces the whole definition (including any exact theme-name overrides previously added through RegisterForTheme(string, string, CliCellStyle)).
public TigerCustomStyleRegistry Register(string name, ThemeStyle baseStyle, CliCellStyle? darkStyle = null, CliCellStyle? lightStyle = null)

Parameters

name string
baseStyle ThemeStyle
darkStyle CliCellStyle
lightStyle CliCellStyle

Returns

TigerCustomStyleRegistry

Exceptions

ArgumentException
The name is invalid or collides with a framework semantic token.

RegisterForTheme(string, string, CliCellStyle)

Adds an exact theme-name override to an already-registered custom style. Theme-name overrides win over dark/light family overrides. The custom style must already be registered (the required base style is established by Register(string, ThemeStyle, CliCellStyle?, CliCellStyle?)).
public TigerCustomStyleRegistry RegisterForTheme(string styleName, string themeName, CliCellStyle style)

Parameters

styleName string
themeName string
style CliCellStyle

Returns

TigerCustomStyleRegistry

Exceptions

ArgumentException
styleName is not registered, or themeName is empty.

Remove(string)

Removes a custom style if present. Returns true when one was removed.
public bool Remove(string name)

Parameters

name string

Returns

bool

TryGet(string, out CliCustomStyle?)

Tries to get a registered custom style by name (case-insensitive).
public bool TryGet(string name, out CliCustomStyle? style)

Parameters

name string
style CliCustomStyle

Returns

bool