TextLineInfo Struct
Definition
A lightweight struct representing line information for caret positioning and navigation. Implements Avalonia.Controls.Documents.Primitives.ITextLine as a value type to avoid allocations.
public struct TextLineInfo
Constructors
| Name | Description |
|---|---|
| TextLineInfo | Creates a new TextLineInfo. |
TextLineInfo Constructor
Creates a new TextLineInfo.
public TextLineInfo(Avalonia.Controls.Documents.TextModel.StaticTextPointer startPosition, Avalonia.Controls.Documents.TextModel.StaticTextPointer endPosition, Avalonia.Rect bounds, double baseline, bool hasLineBreak, object containingElement)
Parameters
startPosition Avalonia.Controls.Documents.TextModel.StaticTextPointer
The start position of the line.
endPosition Avalonia.Controls.Documents.TextModel.StaticTextPointer
The end position of the line.
bounds Avalonia.Rect
The bounding rectangle of the line.
baseline double
The baseline offset from the top.
hasLineBreak bool
Whether the line ends with a hard line break.
containingElement object
The node whose content the line belongs to.
Methods
| Name | Description |
|---|---|
| Equals (2 overloads) | No summary available. |
| GetHashCode | No summary available. |
Equals overloads
Equals Method
public bool Equals(Avalonia.Controls.Documents.Primitives.TextLineInfo other)
Parameters
other Avalonia.Controls.Documents.Primitives.TextLineInfo
Returns
bool
Equals Method
public bool Equals(object obj)
Parameters
obj object
Returns
bool
GetHashCode Method
public int GetHashCode()
Returns
int
Properties
| Name | Description |
|---|---|
| Baseline | Gets the baseline offset from the top of the line. |
| Bounds | Gets the bounding rectangle of this line in view coordinates. |
| ContainingElement | Gets the node whose content this line belongs to, if any. Selection rendering and vertical navigation group lines by it, so a line that reports none is skipped by both. |
| EndPosition | Gets the end position of this line as a lightweight value type. |
| HasLineBreak | Gets whether this line ends with a hard line break. |
| Height | Gets the height of this line. |
| IsValid | Gets whether this line info is valid (non-empty). |
| Length | Gets the character length of text in this line. |
| StartPosition | Gets the start position of this line as a lightweight value type. |
| Width | Gets the width of this line. |
Baseline Property
Gets the baseline offset from the top of the line.
public double Baseline { get; set; }
Bounds Property
Gets the bounding rectangle of this line in view coordinates.
public Avalonia.Rect Bounds { get; set; }
ContainingElement Property
Gets the node whose content this line belongs to, if any. Selection rendering and vertical navigation group lines by it, so a line that reports none is skipped by both.
public object ContainingElement { get; set; }
Remarks
Defaults to so a line written before this member existed still compiles. Such a line is skipped by selection rendering and by vertical navigation, which is the same treatment it received before the member was added.
EndPosition Property
Gets the end position of this line as a lightweight value type.
public Avalonia.Controls.Documents.TextModel.StaticTextPointer EndPosition { get; set; }
HasLineBreak Property
Gets whether this line ends with a hard line break.
public bool HasLineBreak { get; set; }
Height Property
Gets the height of this line.
public double Height { get; set; }
IsValid Property
Gets whether this line info is valid (non-empty).
public bool IsValid { get; set; }
Length Property
Gets the character length of text in this line.
public int Length { get; set; }
StartPosition Property
Gets the start position of this line as a lightweight value type.
public Avalonia.Controls.Documents.TextModel.StaticTextPointer StartPosition { get; set; }
Width Property
Gets the width of this line.
public double Width { get; set; }
Fields
| Name | Description |
|---|---|
| Empty | Represents an empty/invalid text line. |
Empty Field
Represents an empty/invalid text line.
public Avalonia.Controls.Documents.Primitives.TextLineInfo Empty