Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Collapse]Spell Checker
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Collapse]Examples
     How to: Add Dictionaries at Runtime
     How to: Switch Between Languages
     How to: Use the SharedDictionaryStorage Component
     How to: Check Spelling of a Grid Cell
     How to: Turn On the Check-As-You-Type Mode
     How to: Add Spell Check Menu to the Standard Text Controls
     How to: Obtain a List of Commands for the Misspelled Word
     How To: Customize the Spelling Dialog
     How to: Customize the Spelling Options Dialog
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

How to: Use the SharedDictionaryStorage Component

The SharedDictionaryStorage component is implemented to facilitate the usage of multiple dictionaries in an application. The procedure for loading dictionaries takes time, so it's most efficient not to do it twice, but use already loaded dictionaries for all forms.

In this example we add the component to the application's main form and specify the necessary dictionaries.

The SharedDictionaryStorage component shortcut is located near the XtraSpellChecker component in the Visual Studio toolbox.

Drop it onto the main form of your application. A new icon will appear in a component tray. Select it and press F4 to view its property page. Click the Dictionary item in the property grid to invoke the dictionary collection editor.

Assuming that our application will contain text in English and French, we must add dictionaries for both languages, and two custom dictionaries to provide the ability for the user to add special terms and names. The main dictionaries could be obtained from the official page of OpenOffice project, or elsewhere. For the custom dictionaries create two empty files: custom_en-us.dic and custom_fr-fr.dic.

Add two SpellCheckerOpenOfficeDictionary items and two SpellCheckerCustomDictionary items using the Add button of the SpellCheckerDictionaryBase Collection Editor.

Specify the paths to en_US.dic, en_US.aff files for the English, and fr_FR.dic and fr_FR.aff files for the French OpenOffice dictionaries. Notice that the encoding is set automatically to Western European (ISO) for the English, and Latin 9 (ISO) for the French dictionaries. Select the corresponding culture from the list - English (US) for the English dictionary and French (France) for the French.

Specify the paths to custom_en-us.dic and custom_fr-fr.dic files created earlier. Set the culture as you did for the OpenOffice dictionaries, manually specifying the encoding identically for the particular culture, as for the corresponding OpenOffice dictionary.

That's all. For the XtraSpellChecker to make use of this SharedStorageDictionary component, you should set the SpellCheckerBase.UseSharedDictionaries property to true.

Note

The dictionary files are loaded and processed on first call to the check routines of the XtraSpellChecker. You may test the SpellCheckerDictionaryBase.WordCount property of the dictionaries to be sure that they are properly initialized.

How would you rate this topic?​​​​​​​