TX Spell .NET for WPF

What's New in TX Spell .NET for WPF 3.0

Topic

Better suggestions and a spell check dialog you can change were the two main goals of TX Spell .NET for WPF 3.0. The version also added events for dictionaries, user dictionaries and dialog buttons, loaded dictionaries from string arrays instead of files, and returned ready-made items for a context menu of your own.

Version 3.0 was released on September 12, 2012, on its own rather than together with a version of TX Text Control, as the blog article TX Spell .NET 3.0 Released: New Suggestion Engine, Customizable Dialog announced. It lists the features added since version 2.0; the next version is Version 4.0.

Version 3.0 at a Glance

AreaWhat is new
SuggestionsRanking that takes the distance between keys of the current keyboard into account
Spell check dialogSpellCheckDialog with buttons, fonts and a preview you can change, for TX Text Control and other controls
EventsDictionaries added and removed, words added to and removed from user dictionaries, dialog buttons clicked, words changed
DictionariesDictionaries and user dictionaries created from string arrays
Context menusGetMenuItems returns the spell checking items of a context menu
Code without a user interfaceThe TXSpell class

Suggestion Ranking

The suggestion engine was rebuilt for version 3.0. To rank the suggestions for a misspelled word, it measures how far apart the keys of the current keyboard are, so that a letter typed with the key next to the intended one counts as a likely typo. Text Control tested the engine with thousands of documents: in more than 97 percent of the test cases, the suggestion the user expected was ranked first or second.

The suggestions of today's version still take the keyboard into account; Incorrect Words and Suggestions shows how to create them in code.

A Customizable Spell Check Dialog

TXSpellChecker gained the SpellCheckDialog property, which returns the built-in dialog as an object you can change before you open it with Show. The dialog works with TX Text Control and with other controls, such as a RichTextBox or a TextBox, and one dialog can check the text of several controls in a single pass.

Spell Check Dialog describes the dialog and Customizing the Spell Check Dialog changes its buttons, fonts and preview.

New Events

TXSpellChecker raises events for the actions of the user and of your code:

Events shows what each event is for.

Dictionaries From Memory

Dictionaries no longer have to be files. An OpenOfficeDictionary can be created from the lines of its dictionary file and its affix file as two string arrays, and a UserDictionary from an array of its lines and a language. The dictionaries can then come from embedded resources or a database, and user dictionaries can be saved to a string array as well. The blog article TX Spell .NET 3.0: Loading Dictionaries from Embedded Resources loaded a dictionary this way when the version was new; Loading and Managing Dictionaries does it with the current version.

Context Menu Items

GetMenuItems returns an array of MenuItem objects for a misspelled word, ready to be added to a context menu of your own next to your own items. The Type of each item, a TXSpell.MenuItemType value, is AddToDictionary, Delete, IgnoreAll, IgnoreOnce, NoSuggestions or Suggestion. Context Menus builds such a menu.

Service Packs

  • Service Pack 1, released on November 22, 2012, made TX Spell .NET 3.0 compatible with Visual Studio 2012. It came as a new setup of the full version, which you ran with Repair. The blog article TX Spell .NET 3.0 SP1 - Visual Studio 2012 Compatibility Pack Released announced it.
  • Service Pack 2 followed on June 25, 2013, with fixes for known issues, as the blog article TX Spell .NET 3.0 Service Pack 2 Released announced.

The download package holds the setup TX Spell .NET for WPF 3.0 SP2.exe, dated June 24, 2013, and the full version setup TX Spell .NET for WPF 3.0.exe, dated June 18, 2013. These are the dates of the setup files, not release dates.

New Classes, Properties, Methods and Events

The classes and members below are the ones that the What's New documentation of version 3.0 lists for TX Spell .NET for WPF. Names are relative to the TXTextControl namespace, and each name links to its current reference page. It gives SuggestionDictionaryComboBox a second time, in the TXTextControl.Proofing namespace; that class belongs to TX Spell .NET for Windows Forms and is left out here.

New Classes

Members by Class

ClassPropertiesMethodsEvents
Proofing.DictionaryLanguage
Proofing.DictionaryAddedEventArgsDictionary
Proofing.DictionaryCollectionHasEditableUserDictionaries, ItemAdd, GetItem, Remove
Proofing.DictionaryRemovedEventArgsDictionary
Proofing.IncorrectWordChangingEventArgsCorrectedText, CorrectedWord, IncorrectWord, SourceText, Type, WillBeDuplicate
Proofing.MisspelledWordChangingEventArgsCorrectedWord, IFormattedText, MisspelledWord, Type, WillBeDuplicate
Proofing.SpelledWordIndex, Length, Start, Text
Proofing.TXSpellAvailableDictionaries, Dictionaries, IgnoreCase, IgnoreWord, IncorrectWords, Language, SuggestionsCheck, Create, CreateSuggestions
Proofing.UserDictionaryWordAddedEventArgsAddedWord, UserDictionary
Proofing.UserDictionaryWordRemovedEventArgsRemovedWord, UserDictionary
WPF.Proofing.DialogButtonEnabled, FontFamily, FontSize, FontStyle, FontWeight, IsDeleteButton, IsUndoEditButton, Text, Type
WPF.Proofing.DialogButtonCollectionItemAdd, AddRange, Remove
WPF.Proofing.DialogButtonEventArgsDialogButton, StateManager
WPF.Proofing.MenuItemType
WPF.Proofing.MenuItemClickedEventArgsMenuItem
WPF.Proofing.OptionsDialogOpeningEventArgsCancel
WPF.Proofing.PreviewEditable, IncorrectWordColor
WPF.Proofing.SpellCheckDialogAcceptButton, ChangeButtons, ChangeInAllTextParts, CloseOnFinished, FontFamily, FontSize, FontStyle, FontWeight, HideSelection, IgnoreButtons, IgnoreInAllTextParts, OptionButtons, Preview, ShowMessageBoxes, SuggestionDictionaryComboBox, SuggestionListShow
WPF.Proofing.SpellCheckDialogClosingEventArgsCancel, StateManager
WPF.Proofing.SpellCheckDialogOpeningEventArgsStateManager
WPF.Proofing.SpellCheckDialogStateManagerNextIFormattedText, NextIncorrectWord, NextMisspelledWordClose, SetNext
WPF.Proofing.SuggestionDictionaryComboBoxIsAllItemEnabled, IsAllItemSelected, SuggestionDictionary
WPF.Proofing.SuggestionListIsNoSuggestionsItemEnabled, MaxSuggestions
WPF.Proofing.TXSpellCheckerAvailableDictionaries, Dictionaries, IgnoreCase, IgnoreWord, IncorrectWords, Language, SpellCheckDialog, SuggestionsCheck, Create, CreateSuggestions, GetMenuItems, OptionsDialogDialogButtonClicked, DictionaryAdded, DictionaryRemoved, IncorrectWordChanging, MenuItemClicked, MisspelledWordChanging, OptionsDialogOpening, SpellCheckDialogClosing, SpellCheckDialogOpening, UserDictionaryWordAdded, UserDictionaryWordRemoved

Next Steps