TXTextControl.Proofing.UserDictionary Class

The UserDictionary class represents a dictionary that allows to use, create and edit user dictionaries. The first constructor creates an empty UserDictionary object with no reference to a file. The second constructor initializes a new UserDictionary object that is filled with the content of a specified word list file. As with all dictionaries of type Dictionary, the content of the dictionary is only accessed when the dictionary was added to the TXSpell.Dictionaries collection. The third constructor loads a dictionary from string arrays that represent the content of an user dictionary. It is recommended to create that array by using the encoding that was used to create the source of that dictionary. Using that implementation, it is required to define the language of the dictionary through the System.Globalization.CultureInfo language parameter that sets the user dictionary's Language property automatically. To declare a specific encoding for the dictionary, use the Dictionary.DictionaryEncoding property. If the encoding is not declared through the property or inside the word list file, the encoding of operation system's current ANSI code page is used. The UserDictionary class is inherited from the abstract class Dictionary.

Syntax

[C#]
public class UserDictionary : Dictionary
[Visual Basic]
Public Class UserDictionary
  Inherits Dictionary

Constructors

Constructor Description
UserDictionary Overloaded. Initializes a new instance of the UserDictionary class.

Properties

Property Description
IsEditable Gets or sets a value indicating whether the user dictionary is editable or not.

Methods

Method Description
AddWord Adds a word to the user dictionary.
RemoveAllWords Removes all words from the user dictionary.
RemoveWord Removes a word the user dictionary.
Save Overloaded. Saves the complete content of the user dictionary in a file at the specified path or as a string array.
ToArray Converts all user dictionary entries to a string array.