Class SyntaxHighlightingTools
Syntax highlighting tools
Inheritance
Namespace: Terminaux.Reader.Highlighting
Assembly: Terminaux.dll
Syntax
public static class SyntaxHighlightingTools
Properties
| Edit this page View SourceHighlighterNames
All installed highlighter names
Declaration
public static string[] HighlighterNames { get; }
Property Value
| Type | Description |
|---|---|
| string[] |
Highlighters
All installed highlighters
Declaration
public static SyntaxHighlighting[] Highlighters { get; }
Property Value
| Type | Description |
|---|---|
| SyntaxHighlighting[] |
Methods
| Edit this page View SourceExists(string)
Checks to see if a highlighter exists or not
Declaration
public static bool Exists(string highlighter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | highlighter | A specific highlighter to check |
Returns
| Type | Description |
|---|---|
| bool | True if found; false otherwise. |
ExistsBuiltin(string)
Checks to see if a highlighter is a built-in or not
Declaration
public static bool ExistsBuiltin(string highlighter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | highlighter | A specific highlighter to check |
Returns
| Type | Description |
|---|---|
| bool | True if found; false otherwise. |
GetComponent(string)
Gets the default highlighter
Declaration
public static SyntaxHighlightingComponent GetComponent(string componentName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | componentName | Component name |
Returns
| Type | Description |
|---|---|
| SyntaxHighlightingComponent |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetComponent(string, string)
Gets the default highlighter
Declaration
public static SyntaxHighlightingComponent GetComponent(string highlighter, string componentName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | highlighter | Highlighter name |
| string | componentName | Component name |
Returns
| Type | Description |
|---|---|
| SyntaxHighlightingComponent |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetComponent(SyntaxHighlighting?, string)
Gets the highlighter
Declaration
public static SyntaxHighlightingComponent GetComponent(SyntaxHighlighting? highlighter, string componentName)
Parameters
| Type | Name | Description |
|---|---|---|
| SyntaxHighlighting | highlighter | Highlighter |
| string | componentName | Component name |
Returns
| Type | Description |
|---|---|
| SyntaxHighlightingComponent |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetHighlighter()
Gets the default highlighter for the current read. Returns null if no reader is present.
Declaration
public static SyntaxHighlighting? GetHighlighter()
Returns
| Type | Description |
|---|---|
| SyntaxHighlighting |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetHighlighter(string)
Gets the highlighter
Declaration
public static SyntaxHighlighting GetHighlighter(string highlighter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | highlighter | Highlighter name |
Returns
| Type | Description |
|---|---|
| SyntaxHighlighting |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetHighlighterFromJson(string)
Gets a highlighter from its JSON representation
Declaration
public static SyntaxHighlighting? GetHighlighterFromJson(string json)
Parameters
| Type | Name | Description |
|---|---|---|
| string | json | Highlighter JSON contents |
Returns
| Type | Description |
|---|---|
| SyntaxHighlighting | A highlighter info containing JSON representation |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetHighlighterToJson()
Gets a JSON representation of the highlighter
Declaration
public static string GetHighlighterToJson()
Returns
| Type | Description |
|---|---|
| string | A string containing the JSON representation of a highlighter |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetHighlighterToJson(string)
Gets a JSON representation of the highlighter
Declaration
public static string GetHighlighterToJson(string highlighter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | highlighter | Highlighter name to save to JSON |
Returns
| Type | Description |
|---|---|
| string | A string containing the JSON representation of a highlighter |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
GetHighlighterToJson(SyntaxHighlighting?)
Gets a JSON representation of the highlighter
Declaration
public static string GetHighlighterToJson(SyntaxHighlighting? highlighter)
Parameters
| Type | Name | Description |
|---|---|---|
| SyntaxHighlighting | highlighter | Highlighter to save to JSON |
Returns
| Type | Description |
|---|---|
| string | A string containing the JSON representation of a highlighter |
Exceptions
| Type | Condition |
|---|---|
| TerminauxException |
RegisterHighlighter(SyntaxHighlighting)
Registers a highlighter
Declaration
public static void RegisterHighlighter(SyntaxHighlighting highlighter)
Parameters
| Type | Name | Description |
|---|---|---|
| SyntaxHighlighting | highlighter | Highlighter information |
UnregisterHighlighter(string)
Unregisters a highlighter
Declaration
public static void UnregisterHighlighter(string highlighter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | highlighter | Highlighter information |