Skip to content

CodeDocument

Record in Oadm.Sdk.Client.Controls · Oadm.Sdk.Client.dll

What a CodeView shows: the (pretty-printed) text, the language used and its tokens (empty = plain text).

public sealed record CodeDocument(string Text, CodeLanguage Language, IReadOnlyList<CodeToken> Tokens)

Parameters

  • Text: The text to show.
  • Language: The language it was read as.
  • Tokens: The colored ranges; empty for plain text.
bool IsHighlighted { get; }

Whether any range is colored.

CodeLanguage Language { get; init; }

The language it was read as.

string Text { get; init; }

The text to show.

IReadOnlyList<CodeToken> Tokens { get; init; }

The colored ranges; empty for plain text.

static readonly CodeDocument Empty

No text.