Component that provides spell-checking services to controls and applications.

Namespace:  C1.Web.Editor
Assembly:  C1.Web.Editor.2 (in C1.Web.Editor.2.dll)

Syntax

C#
public class C1SpellChecker : Component, 
	ISupportInitialize
Visual Basic (Declaration)
Public Class C1SpellChecker _
	Inherits Component _
	Implements ISupportInitialize

Remarks

The C1SpelChecker component supports three spell-checking modes:

Batch mode

Use the CheckText(String), CheckWord(String), and GetSuggestions(String, Int32) methods to check strings and get lists of errors and spelling suggestions.

Dialog mode

Use the [!:CheckControl(ISpellCheckableEditor)] method to check the content of any TextBoxBase-derived controls using a modal dialog. The C1SpellChecker will check the text and display a dialog where the user can choose to correct or ignore each error.

You can also check editors that do not derive from TextBoxBase. To do that, you have to create a wrapper class that implements the [!:ISpellCheckableEditor] interface.

As-you-type mode

Set the extender property SpellCheck on any TextBoxBase-derived control to true, and the C1SpellChecker will monitor changes to the control. Any spelling mistakes will be indicated on the control by a red, wavy underline; right-clicking the errors will show a context menu with spelling suggestions.

You can also provide as-you-type spelling support for editors that do not derive from TextBoxBase. To do that, you have to create a wrapper class that implements the [!:ISpellCheckableRichEditor] interface.

Dictionary Deployment

The C1SpellChecker component uses spelling dictionaries stored in files with a 'dct' extension.

To select which dictionary to use, use the MainDictionary property and set FileName to the name of the file you want to use.

The easiest way to ensure the dictionary is deployed correctly is to add to your projects a reference to the dictionary file(s) you want to use, then set the Build Action property to None and the Copy to Output Directory property to Copy if newer. This way, the dictionaries will be copied to the output directory along with the application executable and the C1SpellChecker assembly.

When using this deployment method, make sure the main dictionary's FileName value specifies a file name without a path. This way, the component will search for the dictionary in the directory where the C1SpellChecker assembly is located.

Inheritance Hierarchy

System..::..Object
  System..::..MarshalByRefObject
    System.ComponentModel..::..Component
      C1.Web.Editor..::..C1SpellChecker

See Also