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
verifyAccessAction
Properties
Count
Gets the number of registered rules.
public int Count { get; }
Property Value
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
beforeTextSnapshotinputTextSnapshotbeforeSelectionsTextSelectionSetselectionsTextSelectionSetinputChangesIEnumerable<TextReplacement>isCompositionCommitbool
Returns
Register(Action<TextInputContext>, int)
Registers a synchronous rule. Disposing the registration removes it.
public IDisposable Register(Action<TextInputContext> rule, int priority = 0)
Parameters
ruleAction<TextInputContext>priorityint