Skip to main content

TextDocumentNodeKind Struct

Definition​

Assembly:Avalonia.Controls.Documents
Package:Avalonia.Controls.Documents

Identifies the kind of a document node. Built-in kinds are provided as static fields. Custom kinds can be registered via Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind.Register(string,Avalonia.Controls.Documents.TextModel.NodeKindFlags).

public struct TextDocumentNodeKind

Inheritance: ValueType -> TextDocumentNodeKind

Implements: IEquatable<TextDocumentNodeKind>

Methods​

NameDescription
Equals (2 overloads)Returns if this kind equals other.
GetHashCodeNo summary available.
Register (4 overloads)Registers a custom node kind with the given name and category flags.
ToStringNo summary available.
TryGetByNameNo summary available.

Equals overloads​

Equals Method​

Returns if this kind equals other.

public bool Equals(Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind other)
Parameters​

other Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

Register overloads​

Register Method​

Registers a custom node kind with the given name and category flags.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Register<TElement>(string name, Avalonia.Controls.Documents.TextModel.NodeKindFlags flags)
Parameters​

name string

Unique name for the kind. Must not collide with an existing registration.

flags Avalonia.Controls.Documents.TextModel.NodeKindFlags

Category flags that determine schema behavior.

Returns​

Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind

The newly registered kind.

Exceptions​

Register Method​

Registers a custom node kind with an Avalonia.Controls.Documents.TextModel.INodeKindHandler that provides element creation, snapshot capture, and formatting restoration.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Register<TElement>(string name, Avalonia.Controls.Documents.TextModel.NodeKindFlags flags, Avalonia.Controls.Documents.TextModel.INodeKindHandler handler)
Parameters​

name string

Unique name for the kind.

flags Avalonia.Controls.Documents.TextModel.NodeKindFlags

Category flags that determine schema behavior.

handler Avalonia.Controls.Documents.TextModel.INodeKindHandler

Handler that manages the snapshot lifecycle for this kind.

Returns​

Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind

The newly registered kind.

Register Method​

Registers a custom node kind and associates it with a Avalonia.Controls.Documents.RichTextElement type so that Avalonia.Controls.Documents.TextModel.TextDocumentNodeFactory.GetKindForElement(Avalonia.Controls.Documents.RichTextElement) can resolve it.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Register(string name, Avalonia.Controls.Documents.TextModel.NodeKindFlags flags, Type elementType)
Parameters​

name string

Unique name for the kind. Must not collide with an existing registration.

flags Avalonia.Controls.Documents.TextModel.NodeKindFlags

Category flags that determine schema behavior.

elementType Type

The element type this kind maps to.

Returns​

Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind

The newly registered kind.

Remarks​

Call Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind.Register<T>(string,Avalonia.Controls.Documents.TextModel.NodeKindFlags), which cannot be handed a type that is not a Avalonia.Controls.Documents.RichTextElement.

Register Method​

Registers a custom node kind with an element type mapping and an Avalonia.Controls.Documents.TextModel.INodeKindHandler for full snapshot lifecycle support.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Register(string name, Avalonia.Controls.Documents.TextModel.NodeKindFlags flags, Type elementType, Avalonia.Controls.Documents.TextModel.INodeKindHandler handler)
Parameters​

name string

Unique name for the kind. Must not collide with an existing registration.

flags Avalonia.Controls.Documents.TextModel.NodeKindFlags

Category flags that determine schema behavior.

elementType Type

The element type this kind maps to.

handler Avalonia.Controls.Documents.TextModel.INodeKindHandler

Handler that manages the snapshot lifecycle for this kind.

Returns​

Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind

The newly registered kind.

Remarks​

Call Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind.Register<T>(string,Avalonia.Controls.Documents.TextModel.NodeKindFlags,Avalonia.Controls.Documents.TextModel.INodeKindHandler), which cannot be handed a type that is not a Avalonia.Controls.Documents.RichTextElement.

ToString Method​

public string ToString()

Returns​

string

TryGetByName Method​

public bool TryGetByName(string name, Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind& kind)

Parameters​

name string

kind Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind&

Returns​

bool

Properties​

NameDescription
FlagsCategory flags used by schema validation.
IsRootWhether the kind is a document root; see Avalonia.Controls.Documents.TextModel.NodeKindFlags.Root.
NameHuman-readable name (e.g. "Paragraph", "CodeBlock").

Flags Property​

Category flags used by schema validation.

public Avalonia.Controls.Documents.TextModel.NodeKindFlags Flags { get; set; }

IsRoot Property​

Whether the kind is a document root; see Avalonia.Controls.Documents.TextModel.NodeKindFlags.Root.

public bool IsRoot { get; set; }

Name Property​

Human-readable name (e.g. "Paragraph", "CodeBlock").

public string Name { get; set; }

Fields​

NameDescription
BlockA generic block kind.
BlockUIContainerA block UI container kind.
BoldA bold inline container kind.
DocumentThe root document node kind.
FootnoteThe root of a footnote's document: a note is a nested document paired with its anchor by note id. It survives while empty - the note goes with its anchor.
FootnoteCitationA further citation of a note that already has its anchor: a second reference to the same note, or a reference from inside another note. Like the anchor it is an atom of one object replacement character showing the note's number, but it owns no note - deleting it leaves the note and the numbering alone.
FootnoteReferenceA footnote anchor leaf. Its text range holds the note's number (the anchor order ordinal), so it renders and exports as plain text; the paired note is a nested document in the document's Avalonia.Controls.Documents.TextModel.TextDocument.Footnotes.
HyperlinkA hyperlink inline container kind.
ImageAn inline image kind. Occupies a single object-replacement character.
InlineUIContainerAn inline UI container kind.
ItalicAn italic inline container kind.
LineBreakA line break leaf kind.
ListA list block kind.
ListItemA list item block container kind.
PageBandThe root of a page band's document: a header or footer is a nested document whose root carries this kind instead of Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind.Document, so what a document is travels with its tree and its snapshots.
PageNumberFieldA page-number field kind (current page / page count). Its text range holds the field's last calculated result, so it renders and exports as plain text until paginated rendering resolves it.
ParagraphA paragraph inline container kind.
RunA text run leaf kind.
SectionA section block container kind.
SpanA span inline container kind.
SubscriptA subscript inline container kind.
SuperscriptA superscript inline container kind.
TableA table block kind.
TableCellA table cell block container kind.
TableRowA table row kind.
TableRowGroupA table row group kind.
UnderlineAn underline inline container kind.

Block Field​

A generic block kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Block

BlockUIContainer Field​

A block UI container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind BlockUIContainer

Bold Field​

A bold inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Bold

Document Field​

The root document node kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Document

Footnote Field​

The root of a footnote's document: a note is a nested document paired with its anchor by note id. It survives while empty - the note goes with its anchor.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Footnote

FootnoteCitation Field​

A further citation of a note that already has its anchor: a second reference to the same note, or a reference from inside another note. Like the anchor it is an atom of one object replacement character showing the note's number, but it owns no note - deleting it leaves the note and the numbering alone.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind FootnoteCitation

FootnoteReference Field​

A footnote anchor leaf. Its text range holds the note's number (the anchor order ordinal), so it renders and exports as plain text; the paired note is a nested document in the document's Avalonia.Controls.Documents.TextModel.TextDocument.Footnotes.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind FootnoteReference

A hyperlink inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Hyperlink

Image Field​

An inline image kind. Occupies a single object-replacement character.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Image

InlineUIContainer Field​

An inline UI container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind InlineUIContainer

Italic Field​

An italic inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Italic

LineBreak Field​

A line break leaf kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind LineBreak

List Field​

A list block kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind List

ListItem Field​

A list item block container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind ListItem

PageBand Field​

The root of a page band's document: a header or footer is a nested document whose root carries this kind instead of Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind.Document, so what a document is travels with its tree and its snapshots.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind PageBand

PageNumberField Field​

A page-number field kind (current page / page count). Its text range holds the field's last calculated result, so it renders and exports as plain text until paginated rendering resolves it.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind PageNumberField

Paragraph Field​

A paragraph inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Paragraph

Run Field​

A text run leaf kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Run

Section Field​

A section block container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Section

Span Field​

A span inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Span

Subscript Field​

A subscript inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Subscript

Superscript Field​

A superscript inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Superscript

Table Field​

A table block kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Table

TableCell Field​

A table cell block container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind TableCell

TableRow Field​

A table row kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind TableRow

TableRowGroup Field​

A table row group kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind TableRowGroup

Underline Field​

An underline inline container kind.

public Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind Underline