TXTextControl.WPF.Proofing.TXSpellChecker Class

The TXSpellChecker class implements a component with spell checking features. It allows to set general spell checking settings by using an options dialog, to invoke a customizable SpellCheckDialog that can be connected to different types of controls (e.g. TXTextControl.WPF.TextControl and System.Windows.Controls.RichtTextBox) and to create a spell checking context menu by using the TXSpellChecker.GetMenuItems method. Currently, TXTextControl (version 17.0 and better) provides the WPF.TextControl.SpellChecker Property to connect the TXSpellChecker with its TextControl component. To invoke the internal or an own spell check context menu on right-clicking a misspelled word, the WPF.TextControl.SpellCheckContextMenuStrip proeprty must be set. The following describes only the properties, methods and events defined through the TXSpellChecker class.

Syntax

[C#]
public sealed class TXSpellChecker
[Visual Basic]
Public NotInheritable Class TXSpellChecker

Constructors

Constructor Description
TXSpellChecker Overloaded. Initializes a new instance of the TXSpellChecker class.

Properties

Property Description
AvailableDictionaries Gets a list of all available dictionaries in the default dictionary folder.
AvailableHyphenationLists Gets a list of all available hyphenation lists of the default hyphenation lists folder.
DetectableLanguageScopes Gets or sets a list of all languages that are used to detect language scopes in a text.
Dictionaries Gets a collection of all added and validated dictionaries.
HyphenationLanguage Gets or sets the name of a hyphenation list that is located at the default hyphenation lists folder. When using the HyphenationLanguage property, the Hyphenation.IsSelectedAsDefault property of the chosen hyphenation list is set to true.
HyphenationLists Gets a collection of all added hyphenation dictionaries.
IgnoreCase Gets or sets a value of type IgnoreCaseSettings determining if and how the case of a word is ignored while spell checking.
IgnoreWord Gets or sets a value of type IgnoreWordSettings determining when a word should not be spell checked.
IncorrectWords Gets a collection of all incorrect words that were detected by the last call of the TXSpellChecker.Check method.
Language Gets or sets the name of a dictionary that is located at the default dictionary folder. Using the Language property, the Dictionary.IsSelectedAsDefault property of the chosen dictionary is set to true.
LanguageScopes Gets a collection of all detected language scopes.
SpellCheckDialog Gets an object of type SpellCheckDialog that is used to modify and show the built-in SpellCheckDialog.
SpellingCorrectionUIProvider Gets an object of type SpellingCorrectionUIProvider to provide methods and properties for constructing a spelling correction user interface.
Suggestions Gets a collection of suggestions that were created by the last call of the TXSpellChecker.CreateSuggestions method.

Methods

Method Description
Check Overloaded. Checks text for spelling errors and fills the IncorrectWordCollection at TXSpellChecker.IncorrectWords with all incorrect words.
Create Initializes the resources of a newly instantiated TXSpellChecker object.
CreateSuggestions Overloaded. Determines suggestions for a specific incorrect word by using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries and adds the results to the SuggestionCollection at TXSpellChecker.Suggestions. If no maximum number of suggestions is specified, all created suggestions are added to TXSpellChecker.Suggestions.
DetectLanguageScopes Detects language scopes in a text and fills the results into the LanguageScopeCollection at TXSpellChecker.LanguageScopes.
GetHyphenationPoint Overloaded. Returns the next hyphenation point for a specific word right before a defined divide position.
GetHyphenationPoints Overloaded. Returns an array of all hyphenation points for a word.
GetMenuItems Overloaded. Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.
OptionsDialog Overloaded. Invokes the built-in dialog box to define spell check, create suggestions and hyphenation settings.

Events

Event Description
DialogButtonClicked Occurs when a dialog button of the built-in SpellCheckDialog is clicked.
DictionaryAdded Occurs when a dictionary is added to the TXSpellChecker.Dictionaries DictionaryCollection.
DictionaryRemoved Occurs when a dictionary is removed from the TXSpellChecker.Dictionaries DictionaryCollection.
IncorrectWordChanging Occurs when an object of type IncorrectWord is changing by spell check context menu or spell check dialog operations.
MenuItemClicked Occurs when a MenuItem is clicked.
MisspelledWordChanging Occurs when an object of type TXTextControl.MisspelledWord is changing by spell check context menu or spell check dialog operations.
OptionsDialogOpening Occurs when the built-in options dialog is invoked by the TXSpellChecker.OptionsDialog method or clicking the Options... button of the built-in SpellCheckDialog.
SpellCheckDialogClosing Occurs when the built-in spell check dialog is closing.
SpellCheckDialogOpening Occurs when the built-in spell check dialog is invoked using the SpellCheckDialog.Show method.
UserDictionaryWordAdded Occurs when a word is added to a user dictionary.
UserDictionaryWordRemoved Occurs when a word is removed from a user dictionary.