GetMenuItems Method
- Namespace
TXTextControl.WPF. Proofing
- Package
TXTextControl.asTXSpell. WPF. SDK TXSpell.from the private NuGet feed or Text Control Offline PackagesWPF. dll
Description
Returns an array of MenuItems, which are used to create a custom spell check ContextMenu.
Syntax
GetMenuItems(object, object, int)
Returns an array of MenuItems for a specific object of type TXTextControl.MisspelledWord.
public MenuItem[] GetMenuItems(object misspelledWord, object textControl, int maxSuggestions);Public Function GetMenuItems(misspelledWord As Object, textControl As Object, maxSuggestions As Integer) As MenuItem()| Parameter | Description |
|---|---|
| misspelledWord | The misspelled word of type |
| textControl | The control of type |
| maxSuggestions | The maximum number of suggestions that should be created for the incorrect word. |
GetMenuItems(IncorrectWord, string, int)
Returns an array of MenuItems for a specific IncorrectWord.
public MenuItem[] GetMenuItems(IncorrectWord incorrectWord, string sourceText, int maxSuggestions);Public Function GetMenuItems(incorrectWord As IncorrectWord, sourceText As String, maxSuggestions As Integer) As MenuItem()| Parameter | Description |
|---|---|
| incorrectWord | The misspelled word of type IncorrectWord for that the array of menu items is created. |
| sourceText | The text that contains the misspelled word. |
| maxSuggestions | The maximum number of suggestions that should be created for the incorrect word. |
Return Value
The array of type WPF.MenuItem for the specified misspelled word.
Examples
The following example retrieves menu items from the txspell checker.
TXTextControl.WPF.Proofing.MenuItem[] results = tXSpellChecker.GetMenuItems(new TXTextControl.Proofing.IncorrectWord(), "Quarterly results", 10);
foreach (TXTextControl.WPF.Proofing.MenuItem menuItem in results)
{
Console.WriteLine(menuItem);
}Dim results As TXTextControl.WPF.Proofing.MenuItem() = tXSpellChecker.GetMenuItems(New TXTextControl.Proofing.IncorrectWord(), "Quarterly results", 10)
For Each menuItem As TXTextControl.WPF.Proofing.MenuItem In results
Console.WriteLine(menuItem)
Next