Table of Contents

Class CodeTextSelection

Namespace
CodeEdit.Maui
Assembly
CodeEdit.Maui.dll

A stable source-only selection facade.

public sealed class CodeTextSelection : INotifyPropertyChanged
Inheritance
CodeTextSelection
Implements
Inherited Members

Properties

Active

Gets the caret endpoint.

public int Active { get; }

Property Value

int

Anchor

Gets the fixed endpoint.

public int Anchor { get; }

Property Value

int

Range

Gets the normalized UTF-16 range.

public TextSpan Range { get; }

Property Value

TextSpan

State

Gets the anchor and active endpoints.

public TextSelectionState State { get; }

Property Value

TextSelectionState

Text

Gets the selected source.

public string Text { get; }

Property Value

string

Methods

ReplaceText(string?)

Replaces the selection with source text and advances the caret.

public void ReplaceText(string? text)

Parameters

text string

The replacement source.

Select(TextSelectionState)

Sets a directional selection.

public void Select(TextSelectionState selection)

Parameters

selection TextSelectionState

The anchor and active offsets.

Select(TextSpan)

Selects a range with the caret at its end.

public void Select(TextSpan range)

Parameters

range TextSpan

The range to select.

Events

PropertyChanged

public event PropertyChangedEventHandler? PropertyChanged

Event Type

PropertyChangedEventHandler