TX Spell .NET for Windows Forms

StateManager Class

Class|Introduced in 6.0
Namespace
TXTextControl.Proofing
Package
TXTextControl.TXSpell.WinForms.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXSpell.dll
Install
dotnet add package TXTextControl.TXSpell.WinForms.SDK .NET 8 and later. For .NET Framework, reference TXSpell.dll from the setup.
Also in
TXTextControl.TXSpell.Core.SDK as TXSpell.dll
Implements
INotifyPropertyChanged

Description

The StateManager class provides methods and properties which are necessary to initialize, modify and perceive the current state of a spelling correction procedure..

Syntax

public sealed class SpellingCorrectionUIProvider.StateManager : INotifyPropertyChanged

Examples

The following example includes the current iformatted text value from a State Manager object in application diagnostics. The created object is then available to the surrounding document workflow.

Console.WriteLine($"Current IFormatted Text: {stateManager.CurrentIFormattedText}");
Console.WriteLine("State Manager is ready for use.");

Members

Properties

PropertyDescription
CurrentIFormattedTextGets that object of type TXTextControl.IFormattedText that includes the misspelled word which is currently handled by the SpellingCorrectionUIProvider. This property is updated when the CurrentWordToCorrect is redifined.
CurrentTextGets that text which is currently handled by the SpellingCorrectionUIProvider. This property can be set by calling the SetCurrent(string text) method. Furthermore, it will be set to null by calling the SetCurrent(string text) method with a null parameter, setting the CurrentTextControl property or using the Cancel method.
CurrentTextControlGets an object of type TXTextControl.TextControl and represents that TextControl which is currently handled by the SpellingCorrectionUIProvider. This property can be set by calling the SetCurrent(object textControl) method. Furthermore, it will be set to null by calling the SetCurrent(object textControl) method with a null parameter, setting the CurrentText property or using the Cancel method.
CurrentWordToCorrectGets an object of type TXTextControl.MisspelledWord or IncorrectWord and represents that current word to correct which is currently handled by the SpellingCorrectionUIProvider. It is redetermined on every invocation of SetCurrent, IsOptionsSetting or the TXSpell.SpellingCorrectionUIProvider.CorrectionHandler methods (AddToDictionary(), Change(string correctedWord), ChangeAll(string correctedWord), Delete(), Ignore(), IgnoreAll()). Changes on this property lead to an update of the Mode property. If the source of the word to correct is an object of type TXTextControl.TextControl, the CurrentIFormattedText property is updated as well.
IsOptionsSettingsGets or sets a value whether the current state of the SpellingCorrectionUIProvider is set to OptionsSettings. If the value is true, no other method or property of the SpelleingCorrectionUIProvider except the Cancel method is enabled or enabled to be modified.
IsWordToCorrectEditingGets or sets a value whether the current state of the SpellingCorrectionUIProvider is set to WordToCorrectEditing. Setting this property is only enabled if the CurrentWordToCorrect property is not null.
ModeGets a value of type SpellingCorrectionMode that represents the current state of the SpellingCorrectionUIProvider.

Methods

MethodDescription
CancelResets the SpellingCorrectionUIProvider to the InitialState.
SetCurrentSets an object of type TXTextControl.TextControl or text for user interface based spelling correction. Furthermore, overloads of the method determine and set a specific incorrect or misspelled (TXTextControl.MisspelledWord) word based on a specific text position to handle it by the SpellingCorrectionUIProvider.

Events

EventDescription
PropertyChangedNot described in the reference. public event PropertyChangedEventHandler PropertyChanged;