TX Spell .NET for Windows Forms

SetNext Method

Method|Introduced in 3.0
Namespace
TXTextControl.Proofing
Package
TXTextControl.TXSpell.WinForms.SDK as TXSpell.Windows.Forms.dll from the private NuGet feed or Text Control Offline Packages

Description

Provides a method to set a specific incorrect or misspelled (TXTextControl.MisspelledWord) word, that should be handled next by the SpellCheckDialog. Furthermore, a complete new text or an object of type TXTextControl.TextControl can be set to the SpellCheckDialog. A new incorrect word or misspelled word (TXTextControl.IFormattedText.MisspelledWords) collection is connected and handled.

Syntax

SetNext(string)

Sets the text that should be handled next by the SpellCheckDialog.

public void SetNext(string text);
ParameterDescription
text

The text that should be handled next by the SpellCheckDialog.

SetNext(IncorrectWord)

Sets the incorrect word that should be handled next by the SpellCheckDialog.

public void SetNext(IncorrectWord incorrectWord);
ParameterDescription
incorrectWord

The object of type IncorrectWord that should be handled next by the SpellCheckDialog. It must be part of the incorrect word collection that was created by calling the SetNext method with a string parameter or connected by invoking the SpellCheckDialog with the first or second overload of the TXSpellChecker.SpellCheckDialog.Show method.

SetNext(object)

Sets an object of type TXTextControl.TextControl that should be handled next by the SpellCheckDialog.

public void SetNext(object textControl);
ParameterDescription
textControl

The object of type TXTextControl.TextControl that should be handled next by the SpellCheckDialog.

SetNext(object, object)

Sets an object of type TXTextConrol.MisspelledWord that should be handled next by the SpellCheckDialog.

public void SetNext(object misspelledWord, object iFormattedText);
ParameterDescription
misspelledWord

The object of type TXTextControl.MisspelledWord that should be handled next by the SpellCheckDialog.

iFormattedText

The object of type TXTextControl.IFormattedText that contains the misspelled word (TXTextControl.MisspelledWord).

Examples

The following example uses Set Next in a focused Spell Check Dialog State Manager workflow. The created object is then available to the surrounding document workflow.

spellCheckDialogStateManager.SetNext("Approved", "Approved");
Console.WriteLine("Spell Check Dialog State Manager is ready for use.");

Remarks

An exception is thrown for the second overload, if the SpellCheckDialog is connected to an instance of TXTextControl.WPF.TextControl.

An exception is thrown for the fourth overload, if the SpellCheckDialog is not connected to an instance of TXTextControl.TextControl object of which TextPartCollection contains the iFormattedText parameter.