SetCurrent Method
- Namespace
TXTextControl.Proofing
- Package
TXTextControl.asTXSpell. WinForms. SDK TXSpell.from the private NuGet feed or Text Control Offline Packagesdll
- Also in
TXTextControl.asTXSpell. Core. SDK TXSpell.dll
Description
Sets 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.
Syntax
SetCurrent(object)
Sets an object of type TXTextControl.TextControl as CurrentTextControl to handle it by the SpellingCorrectionUIProvider. If the parameter is not null, the first TXTextControl.MisspelledWord of the TextControl is set as CurrentWordToCorrect and the corresponding TXTextControl.IFormattedText object as CurrentIFormattedText. Otherwise the SpellingCorrectionUIProvider's mode is reset to InitialState. If the TXTextControl.TextControl parameter does not contain misspelled words, the mode is set to NoWordsToCorrectFound.
public void SetCurrent(object textControl);Public Sub SetCurrent(textControl As Object)| Parameter | Description |
|---|---|
| textControl | The object of type |
SetCurrent(string)
Sets the text that is handled by the SpellingCorrectionUIProvider as current text. If the parameter is not null, the first incorrect word of the text is set as CurrentWordToCorrect. Otherwise the SpellingCorrectionUIProvider's mode is reset to InitialState. If the text parameter does not contain incorrect words, the mode is set to NoWordsToCorrectFound.
public void SetCurrent(string text);Public Sub SetCurrent(text As String)| Parameter | Description |
|---|---|
| text | The text that is handled by the SpellingCorrectionUIProvider. |
Return Value
SetCurrent methods including a textPosition parameter return true if the corresponding CurrentWordToCorrect property is changed on calling this method. Otherwise false.
Examples
The following example uses Set Current in a focused State Manager workflow. The created object is then available to the surrounding document workflow.
stateManager.SetCurrent("Approved");
Console.WriteLine("State Manager is ready for use.");stateManager.SetCurrent("Approved")
Console.WriteLine("State Manager is ready for use.")Remarks
Throws an exception if the IsOptionsSettings property is set to true.