December 12, 2005
12:57 PM

Someone finally asked me if I had actually released the Tablet Dictionary Manager I wrote about almost exactly one year ago. Well, I hadn't, but I will now.

Dictionary Manager 1.1, requires CLR 2.0:

Features:

  • Add words
  • Delete words
  • Check for recognised words.
  • Export user dictionary.
  • Import from plugin:
    • .NET Assembly
    • Text File
    • Outlook Contacts

Writing your own plugin is straightforward:

  1. Reference DictionaryManager.exe
  2. Create a static method that retuns List<String>
  3. Mark it with the DictionaryPlugin attribute
  4. Compile
  5. Place the dll in the DictionaryManager directory

Rather than going into more detail, here's the source code for the .NET Assembly plugin:

public static class Default
{
    [DictionaryManager.DictionaryPlugin(".NET Assembly")]
    public static List<string> ReadFile()
    {
        List<string> result = new List<string>();
        OpenFileDialog ofd = new OpenFileDialog();
        ofd.Filter = ".NET Assembly|.dll";

        if (ofd.ShowDialog() == DialogResult.OK)
        {
            System.Reflection.Assembly assembly = 
                System.Reflection.Assembly.LoadFrom(ofd.FileName);

            foreach (Type t in assembly.GetTypes())
            {
                Add(result, t.Name);
                foreach (MemberInfo member in t.GetMembers())
                {
                    Add(result, member.Name);
                }
            }
        }

        return result;
    }

    public static void Add(List<string> words, string word)
    {
        int index = words.BinarySearch(word);

        if (index < 0)
            words.Insert(~index, word);
    }
}  

Changelog:
11/04/2006 - Dictionary Manager 1.1

  • Bug - "Text File" import did not close file handle.
  • Feature - Support recognition, word operations and dictionary refresh on individual cultures. The current culture can be changed dynamically using the Windows language bar.

© Douglas Stockwell 2007
Creative Commons License Unless otherwise specified all "source code" examples are available for use under the Creative Commons Attribution-Noncommercial 3.0 License. Please contact me if you would like more flexible licensing terms.
Messenger Presence