Check Method
- Namespace
TXTextControl.Proofing
- Package
TXTextControl.asTXSpell. WinForms. SDK TXSpell.from the private NuGet feed or Text Control Offline PackagesWindows. Forms. dll
Description
Checks text for spelling errors and fills the IncorrectWordCollection at TXSpellChecker.IncorrectWords with all incorrect words. The first implementation uses selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries. The second implementation uses selected dictionaries of the TXSpellChecker.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used whose Dictionary.IsSpellCheckingEnabled properties are set to true.
Syntax
Check(string)
Checks text for spelling errors using selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries.
public void Check(string text);Public Sub Check(text As String)| Parameter | Description |
|---|---|
| text | Specifies the text to spell check. |
Check(string, CultureInfo)
Checks text for spelling errors using selected dictionaries of the TXSpellChecker.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter.
public void Check(string text, CultureInfo language);Public Sub Check(text As String, language As CultureInfo)| Parameter | Description |
|---|---|
| text | Specifies the text to spell check. |
| language | The language that is used to spell check the specified text. |
Examples
The following example uses Check in a focused TXSpell Checker workflow. The created object is then available to the surrounding document workflow.
tXSpellChecker.Check("Quarterly results", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Console.WriteLine("TXSpell Checker is ready for use.");tXSpellChecker.Check("Quarterly results", System.Globalization.CultureInfo.GetCultureInfo("en-US"))
Console.WriteLine("TXSpell Checker is ready for use.")Remarks
This method throws an exception, if called while the SpellCheckDialog is open.