TextDocumentNodeKind Struct
Definition
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
Methods
| Name | Description |
|---|---|
| Equals (2 overloads) | Returns if this kind equals other. |
| GetHashCode | No summary available. |
| Register (4 overloads) | Registers a custom node kind with the given name and category flags. |
| ToString | No summary available. |
| TryGetByName | No 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
| Name | Description |
|---|---|
| Flags | Category flags used by schema validation. |
| IsRoot | Whether the kind is a document root; see Avalonia.Controls.Documents.TextModel.NodeKindFlags.Root. |
| Name | Human-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
| Name | Description |
|---|---|
| Block | A generic block kind. |
| BlockUIContainer | A block UI container kind. |
| Bold | A bold inline container kind. |
| Document | The root document node kind. |
| Footnote | 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. |
| FootnoteCitation | 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. |
| FootnoteReference | 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. |
| Hyperlink | A hyperlink inline container kind. |
| Image | An inline image kind. Occupies a single object-replacement character. |
| InlineUIContainer | An inline UI container kind. |
| Italic | An italic inline container kind. |
| LineBreak | A line break leaf kind. |
| List | A list block kind. |
| ListItem | A list item block container kind. |
| PageBand | 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. |
| PageNumberField | 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. |
| Paragraph | A paragraph inline container kind. |
| Run | A text run leaf kind. |
| Section | A section block container kind. |
| Span | A span inline container kind. |
| Subscript | A subscript inline container kind. |
| Superscript | A superscript inline container kind. |
| Table | A table block kind. |
| TableCell | A table cell block container kind. |
| TableRow | A table row kind. |
| TableRowGroup | A table row group kind. |
| Underline | An 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
Hyperlink Field
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