Class TigerConsole
public static class TigerConsole
- Inheritance
-
TigerConsole
- Inherited Members
Properties
ColorAliases
null.public static TigerColorAliasRegistry ColorAliases { get; set; }
Property Value
ColorMode
finally. The full-interactive TUI is unaffected and continues to use the legacy
console sink.public static CliColorMode ColorMode { get; set; }
Property Value
CurrentTheme
null. May be set to any
ITheme, including a custom theme that is not registered (lookup by name still
only finds registered themes, but GetTheme("default") always returns this value).public static ITheme CurrentTheme { get; set; }
Property Value
CustomStyles
null.public static TigerCustomStyleRegistry CustomStyles { get; set; }
Property Value
HyperlinkMode
finally.public static CliHyperlinkMode HyperlinkMode { get; set; }
Property Value
Logger
public static ILogger? Logger { get; set; }
Property Value
OutputEncoding
public static Encoding OutputEncoding { get; set; }
Property Value
Remarks
By default TigerCli writes UTF-8 to redirected output (files, pipes, captured processes) on every platform, and UTF-16 to an interactive Windows console, so every character renders whatever the console code page is. It never changes the console code page, and never replaces a writer installed with SetOut(TextWriter) or SetError(TextWriter). The encoding is set up when an app run starts or TigerCli first writes to the console.
Setting this property replaces that default with the app's own choice: the value is assigned to
OutputEncoding immediately and used for redirected output. On Windows,
assigning any encoding other than UTF-16 changes the console code page, which every process
attached to the console shares and which stays changed after this process exits. Set it at the
start of Main, before TigerCli writes.
TreatDbNullAsNull
public static bool TreatDbNullAsNull { get; set; }
Property Value
Methods
AddOrUpdateCustomTheme(ITheme)
"default" alias cannot be registered.public static void AddOrUpdateCustomTheme(ITheme theme)
Parameters
themeITheme
Exceptions
- ArgumentNullException
themeisnull.- ArgumentException
- The name is empty/whitespace, is
"default", or is framework-owned.
CreateMarkupStyleResolver()
public static ThemeMarkupStyleResolver CreateMarkupStyleResolver()
Returns
CreateMarkupStyleResolver(ITheme)
theme while still honouring the
active custom style registry.public static ThemeMarkupStyleResolver CreateMarkupStyleResolver(ITheme theme)
Parameters
themeITheme
Returns
GetTheme(string)
"default" returns CurrentTheme; every other
name is looked up in the shared framework+custom registry.public static ITheme GetTheme(string name)
Parameters
namestring
Returns
Exceptions
- ArgumentException
- No theme is registered with the given name.
GetThemeNames()
"default" alias (which is not a stored theme). Snapshot; no internal state leaks.public static IReadOnlyCollection<string> GetThemeNames()
Returns
Markup(IFormatProvider, string, params object[])
public static void Markup(IFormatProvider provider, string format, params object[] args)
Parameters
providerIFormatProviderformatstringargsobject[]
Markup(string)
public static void Markup(string markup)
Parameters
markupstring
MarkupError(IFormatProvider, string, params object[])
public static void MarkupError(IFormatProvider provider, string format, params object[] args)
Parameters
providerIFormatProviderformatstringargsobject[]
MarkupError(string)
public static void MarkupError(string markup)
Parameters
markupstring
MarkupErrorLine(IFormatProvider, string, params object[])
public static void MarkupErrorLine(IFormatProvider provider, string format, params object[] args)
Parameters
providerIFormatProviderformatstringargsobject[]
MarkupErrorLine(string)
public static void MarkupErrorLine(string markup)
Parameters
markupstring
MarkupLine()
public static void MarkupLine()
MarkupLine(IFormatProvider, string, params object[])
public static void MarkupLine(IFormatProvider provider, string format, params object[] args)
Parameters
providerIFormatProviderformatstringargsobject[]
MarkupLine(string)
public static void MarkupLine(string markup)
Parameters
markupstring
MarkupToAnsi(string, ITheme?)
[Accent]) are resolved through theme when supplied, otherwise
through CurrentTheme. The base style is plain (no foreground/background), so the
result contains escape sequences only for colours introduced by the markup. Primarily useful
for tests, docs, and generated examples.public static string MarkupToAnsi(string markup, ITheme? theme = null)
Parameters
Returns
MarkupToHtml(string, HtmlSinkOptions?, ITheme?)
[Heading])
are resolved through theme when supplied, otherwise through
CurrentTheme; the resolved CliCharStyle is rendered (the original
token name is not reconstructed). The base style is plain, so only colours/decorations introduced
by the markup appear. Primarily useful for tests, docs, and generated examples.public static string MarkupToHtml(string markup, HtmlSinkOptions? options = null, ITheme? theme = null)
Parameters
markupstringoptionsHtmlSinkOptionsthemeITheme
Returns
Render(CliRenderableComponent)
public static void Render(CliRenderableComponent component)
Parameters
componentCliRenderableComponent
RenderGrid(CliGrid)
public static void RenderGrid(CliGrid grid)
Parameters
gridCliGrid
RenderGrid(CliGrid, ICliRenderSink)
public static void RenderGrid(CliGrid grid, ICliRenderSink sink)
Parameters
gridCliGridsinkICliRenderSink
RenderGrid(TextWriter, CliGrid)
public static void RenderGrid(TextWriter writer, CliGrid grid)
Parameters
writerTextWritergridCliGrid
RenderGrid(int, int, CliGrid)
public static void RenderGrid(int x, int y, CliGrid grid)
Parameters
RenderGrid(int, int, CliRenderBuffer, CliGrid)
public static void RenderGrid(int x, int y, CliRenderBuffer buffer, CliGrid grid)
Parameters
xintyintbufferCliRenderBuffergridCliGrid
Exceptions
- NotImplementedException
- This overload is not implemented.
RenderGridToAnsi(CliGrid)
SoftMaxWidth to emulate a terminal width.public static string RenderGridToAnsi(CliGrid grid)
Parameters
gridCliGrid
Returns
RenderGridToHtml(CliGrid, HtmlSinkOptions?)
public static string RenderGridToHtml(CliGrid grid, HtmlSinkOptions? options = null)
Parameters
gridCliGridoptionsHtmlSinkOptions
Returns
RenderGridToLines(CliGrid)
public static List<string> RenderGridToLines(CliGrid grid)
Parameters
gridCliGrid
Returns
RenderToHtml(CliRenderableComponent, HtmlSinkOptions?)
public static string RenderToHtml(CliRenderableComponent component, HtmlSinkOptions? options = null)
Parameters
componentCliRenderableComponentoptionsHtmlSinkOptions
Returns
RenderToLines(CliRenderableComponent)
public static List<string> RenderToLines(CliRenderableComponent component)
Parameters
componentCliRenderableComponent
Returns
TryGetTheme(string?, out ITheme?)
false (without throwing) for an unknown,
null, empty, or whitespace name. "default" resolves to CurrentTheme.public static bool TryGetTheme(string? name, out ITheme? theme)