Class TigerCustomStyleRegistry
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
Names
The registered custom style names (case-insensitive). Snapshot.
public IReadOnlyCollection<string> Names { get; }
Property Value
Methods
Contains(string)
True when a custom style with this name is registered (case-insensitive).
public bool Contains(string name)
Parameters
namestring
Returns
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
namestringbaseStyleThemeStyledarkStyleCliCellStylelightStyleCliCellStyle
Returns
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
styleNamestringthemeNamestringstyleCliCellStyle
Returns
Exceptions
- ArgumentException
styleNameis not registered, orthemeNameis empty.
Remove(string)
Removes a custom style if present. Returns
true when one was removed.public bool Remove(string name)
Parameters
namestring
Returns
TryGet(string, out CliCustomStyle?)
Tries to get a registered custom style by name (case-insensitive).
public bool TryGet(string name, out CliCustomStyle? style)
Parameters
namestringstyleCliCustomStyle