API Reference
HighlightStyles
Maps highlight roles to theme roles, so highlighted text follows the theme and the colour depth like every other widget: keywords Series5, strings Series2, numbers Series3, keys Series1, types and identifiers Series6, variables Accent2, comments Muted italic, punctuation Muted, links Accent underlined, levels and diff lines by status.
Inheritance
- Object
- HighlightStyles
Methods
public static Style For(HighlightRole role, RenderContext context) #StyleThe style of a role.
Parameters
- role ConsoleMonster.Highlighting.HighlightRole
- The role.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
Returns
The style.
public static List<StyledLine> ToLines(String text, ITextHighlighter? highlighter, RenderContext context, Int32 maxLines = 0) #List<StyledLine>Highlighted text as styled lines: tokens take their role's style, the rest plain. The text is literal (never markup); tabs become spaces to the next multiple of four and other control characters are dropped.
Parameters
- text System.String
- The text.
- highlighter ConsoleMonster.Highlighting.ITextHighlighter?
- The highlighter, or null for plain text.
- context ConsoleMonster.Canvas.RenderContext
- The render context.
- maxLines System.Int32 = 0
- The most lines to return (0 for all).
Returns
The lines.
public static String ToMarkup(String text, ITextHighlighter highlighter) #StringHighlighted text as markup with theme role names (for log regions and other markup sinks). The text is escaped, so nothing in it is read as markup; control characters other than line breaks are dropped.
Parameters
- text System.String
- The text.
- highlighter ConsoleMonster.Highlighting.ITextHighlighter
- The highlighter.
Returns
The markup.
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?