ThesaurusDialog Class
- Namespace
TXTextControl.WPF
- Package
TXTextControl.from the private NuGet feed or Text Control Offline PackagesTextControl. WPF. SDK
- Assembly
TXTextControl.WPF. dll
- Install
dotnet add package TXTextControl..NET 8 and later. For .NET Framework, referenceTextControl. WPF. SDK TXTextControl.from the setup.WPF. dll
- Inherits
- Window
- Thesaurus
Dialog
- Implements
- IComponent
Connector
Description
The ThesaurusDialog class implements a Windows Forms dialog box that shows synonyms for selected text or a word at the current input position which will be selected on opening the dialog. If no text is selected or no word is located at the current input position, the dialog is opened without any created synonyms. For all these cases the dialog provides a text box to enter and edit that text which is used to find synonyms. Furthermore a combo box to select a specific language (a language item represents all enabled thesaurus files with the same culture) or thesaurus file (no language was defined for this file) is placed to the right of the text box. Both typing text into the text box and changing the selected language leads to an update of the displayed synonyms. Additionally new synonyms are created for the current selected synonym when the space key is pressed or the item is double clicked. In this case the back button is enabled to step back to the last synonym search request. To insert a selected synonym into the TextControl or to replace selected text with it, the user can press the Replace button or the Enter key.
Each item of the dialog box has a name, available through its Name property, which corresponds with a member of the WPF.ThesaurusDialog.DialogItem enumeration. The FrameworkElement.FindName method can be used to get a certain item and manipulate, move or delete it.
To use this dialog the TextControl must be connected with an object of type TXSpellChecker (version 7.0 or higher). Otherwise an exception is thrown.
Syntax
public class ThesaurusDialog : Window, IComponentConnectorPublic Class ThesaurusDialog
Inherits Window
Implements IComponentConnectorExamples
The following example creates an ThesaurusDialog object and shows the dialog box:
ThesaurusDialog dlg = new ThesaurusDialog(textControl1);
dlg.ShowDialog();Dim dlg As New ThesaurusDialog(textControl1)
dlg.ShowDialog()The following example creates a Thesaurus Dialog instance and configures its allows transparency setting for a document workflow.
TXTextControl.WPF.ThesaurusDialog thesaurusDialog = new(new TXTextControl.WPF.TextControl());
thesaurusDialog.AllowsTransparency = true;Dim thesaurusDialog As New TXTextControl.WPF.ThesaurusDialog(New TXTextControl.WPF.TextControl())
thesaurusDialog.AllowsTransparency = TrueMembers
Constructors
| Constructor | Description |
|---|---|
| ThesaurusDialog | Creates a ThesaurusDialog object for the specified WPF.TextControl. |
Methods
| Method | Description |
|---|---|
| InitializeComponent | Not described in the reference. public void InitializeComponent(); |
| Show | Not described in the reference. public void Show(); |
| ShowDialog | Not described in the reference. public bool? ShowDialog(); |
Enumerations
| Enumeration | Description |
|---|---|
| DialogItem | Each DialogItem represents an item in a WPF.ThesaurusDialog dialog box. The corresponding string of a DialogItem is the same as the item's Name property. The string can be used with the FrameworkElement.FindName method to get the item and manipulate, move or delete it. |