Table of Contents

Class TextSelection

Namespace
TextEdit.Core
Assembly
TextEdit.Core.dll

A directional selection with an identity retained through edits.

public sealed record TextSelection : IEquatable<TextSelection>
Inheritance
TextSelection
Implements
Inherited Members

Constructors

TextSelection(int, int)

Creates a selection with a new view-local identity.

public TextSelection(int anchor, int active)

Parameters

anchor int
active int

Properties

Active

Gets the moving UTF-16 endpoint.

public int Active { get; init; }

Property Value

int

ActiveVirtualSpaces

Gets the number of unmaterialized spaces beyond the active endpoint's logical line end.

public int ActiveVirtualSpaces { get; init; }

Property Value

int

Affinity

Gets the preferred native visual edge.

public CaretAffinity Affinity { get; init; }

Property Value

CaretAffinity

Anchor

Gets the fixed UTF-16 endpoint.

public int Anchor { get; init; }

Property Value

int

AnchorVirtualSpaces

Gets the number of unmaterialized spaces beyond the anchor's logical line end.

public int AnchorVirtualSpaces { get; init; }

Property Value

int

Id

Gets the stable selection identity.

public Guid Id { get; init; }

Property Value

Guid

IsEmpty

Gets whether both real and virtual endpoints coincide.

public bool IsEmpty { get; }

Property Value

bool

PreferredVisualX

Gets the preferred device-independent X coordinate for native vertical navigation, or null after other movement.

public double? PreferredVisualX { get; init; }

Property Value

double?

Range

Gets the normalized source range.

public TextSpan Range { get; }

Property Value

TextSpan