Skip to main content

BlockSnapshotNode Class

Definition​

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

Base class for block-level snapshot nodes. Contains block formatting information.

public class BlockSnapshotNode

Inheritance: object -> SnapshotNode -> BlockSnapshotNode

Constructors​

NameDescription
BlockSnapshotNodeInitializes a new instance of Avalonia.Controls.Documents.Serialization.Snapshot.BlockSnapshotNode with the specified parameters.

BlockSnapshotNode Constructor​

Initializes a new instance of Avalonia.Controls.Documents.Serialization.Snapshot.BlockSnapshotNode with the specified parameters.

public BlockSnapshotNode(Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind kind, int startOffset, int length, Avalonia.Controls.Documents.TextModel.Formatting.BlockFormatting blockFormatting, Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren children, Avalonia.Controls.Documents.TextModel.Formatting.TextElementFormatting textElementFormatting)

Parameters​

kind Avalonia.Controls.Documents.TextModel.TextDocumentNodeKind

startOffset int

length int

blockFormatting Avalonia.Controls.Documents.TextModel.Formatting.BlockFormatting

children Avalonia.Controls.Documents.Serialization.Snapshot.SnapshotNodeChildren

textElementFormatting Avalonia.Controls.Documents.TextModel.Formatting.TextElementFormatting

Methods​

NameDescription
ChildrenOfKindEnumerates child nodes matching a specific kind. Inherited from SnapshotNode.
EnumerateDescendantsEnumerates this node and all descendants in pre-order (depth-first). Inherited from SnapshotNode.
GetFormatMetadataInherited from SnapshotNode.
SetFormatMetadataInherited from SnapshotNode.

Properties​

NameDescription
BlockFormattingBlock formatting captured from the element.
ChildrenChild nodes. Empty array for leaf nodes. Inherited from SnapshotNode.
CustomDataExtension-specific custom data for custom node kinds. Used by the builder path (Avalonia.Controls.Documents.Serialization.Snapshot.DocumentSnapshotBuilder) to propagate custom data from serializer importers to snapshot nodes. Must be immutable or thread-safe for background serialization. Inherited from SnapshotNode.
EndOffsetGets the absolute end offset (exclusive). Inherited from SnapshotNode.
FormatMetadataFormat-specific metadata for round-trip fidelity. Serializers (RtfWriter, DocxWriter, etc.) can attach format-specific state here to preserve information that doesn't map cleanly to the semantic snapshot model. Not thread-safe; single-threaded access only. Inherited from SnapshotNode.
IsBlockGets whether this is a block-level node. Inherited from SnapshotNode.
IsInlineGets whether this is an inline-level node. Inherited from SnapshotNode.
IsLeafGets whether this is a leaf node (no children). Inherited from SnapshotNode.
IsTextRunGets whether this node represents a text run with actual content. Inherited from SnapshotNode.
KindThe kind of document element this node represents. Inherited from SnapshotNode.
LengthLength of this node's content in characters. Inherited from SnapshotNode.
StartOffsetAbsolute offset in the document text where this node starts. Inherited from SnapshotNode.
TextElementFormattingBase-level formatting from Avalonia.Controls.Documents.RichTextElement. Carries font, foreground, background, and letter-spacing for every node type. Inherited from SnapshotNode.

BlockFormatting Property​

Block formatting captured from the element.

public Avalonia.Controls.Documents.TextModel.Formatting.BlockFormatting BlockFormatting { get; set; }