Table of Contents

Class TextInputRules

Namespace
TextEdit.Core
Assembly
TextEdit.Core.dll

Plans dependent text changes synchronously in ascending priority and registration order.

public sealed class TextInputRules
Inheritance
TextInputRules
Inherited Members

Remarks

Each rule sees the same immutable input. Conflicting replacements reject the whole plan. Registration and planning belong to the owning editor's dispatcher.

Constructors

TextInputRules(Action?)

Creates a rule set with an optional dispatcher-access check supplied by its owner.

public TextInputRules(Action? verifyAccess = null)

Parameters

verifyAccess Action

Properties

Count

Gets the number of registered rules.

public int Count { get; }

Property Value

int

Methods

Plan(TextSnapshot, TextSnapshot, TextSelectionSet, TextSelectionSet, IEnumerable<TextReplacement>, bool)

Validates proposals without modifying any live document. Throws if a rule fails or proposals conflict.

public TextInputPlan Plan(TextSnapshot before, TextSnapshot input, TextSelectionSet beforeSelections, TextSelectionSet selections, IEnumerable<TextReplacement> inputChanges, bool isCompositionCommit = false)

Parameters

before TextSnapshot
input TextSnapshot
beforeSelections TextSelectionSet
selections TextSelectionSet
inputChanges IEnumerable<TextReplacement>
isCompositionCommit bool

Returns

TextInputPlan

Register(Action<TextInputContext>, int)

Registers a synchronous rule. Disposing the registration removes it.

public IDisposable Register(Action<TextInputContext> rule, int priority = 0)

Parameters

rule Action<TextInputContext>
priority int

Returns

IDisposable