Table of Contents

Class TextInputContext

Namespace
TextEdit.Core
Assembly
TextEdit.Core.dll

A synchronous input-rule callback's immutable input and proposed dependent changes.

public sealed class TextInputContext
Inheritance
TextInputContext
Inherited Members

Remarks

All proposals address Input. A callback must not mutate a live editor or retain this builder for later use.

Properties

Before

Gets the committed source before native input.

public TextSnapshot Before { get; }

Property Value

TextSnapshot

BeforeSelections

Gets selections before the originating input.

public TextSelectionSet BeforeSelections { get; }

Property Value

TextSelectionSet

Input

Gets source after the originating input, before any rule proposals.

public TextSnapshot Input { get; }

Property Value

TextSnapshot

InputChanges

Gets the sequential replacements made by originating input.

public ImmutableArray<TextReplacement> InputChanges { get; }

Property Value

ImmutableArray<TextReplacement>

IsCompositionCommit

Gets whether this input commits a completed native composition.

public bool IsCompositionCommit { get; }

Property Value

bool

Selections

Gets selections after originating input, before dependent changes.

public TextSelectionSet Selections { get; }

Property Value

TextSelectionSet

Methods

Replace(TextSpan, string)

Proposes a dependent replacement against Input. Overlapping proposals reject the entire plan.

public void Replace(TextSpan range, string text)

Parameters

range TextSpan
text string

SetSelections(TextSelectionSet)

Proposes all resulting selections in final coordinates. Only one rule can set them.

public void SetSelections(TextSelectionSet selections)

Parameters

selections TextSelectionSet