[]
        
(Showing Draft Content)

C1.Win.C1SpellChecker.C1SpellChecker

C1SpellChecker Class

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

Inheritance
C1SpellChecker
Namespace: C1.Win.C1SpellChecker
Assembly: C1.Win.C1SpellChecker.4.8.dll
Syntax
[ToolboxBitmap(typeof(C1SpellChecker), "C1SpellChecker.png")]
public class C1SpellChecker : Component, IComponent, IDisposable, IExtenderProvider, ISupportInitialize
Remarks

The C1SpelChecker component supports three spell-checking modes:

Batch mode

Use the CheckText(string), CheckWord(string), and GetSuggestions(string, int) 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.

Spell-Checking Options

In all three modes described above, the spell-checker follows rules that can be customized using the Options property. Options available include types of words to ignore (capitalization, numbers, URLs), whether to display suggestions in a context menu, the number of suggestions to display, and so on.

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.

Constructors

Name Description
C1SpellChecker()

Initializes a new instance of a C1SpellChecker.

C1SpellChecker(IContainer)

Initializes a new instance of a C1SpellChecker.

Properties

Name Description
AutoReplaceList

Gets a list of words and replacements to use while spell-checking.

CustomDictionary

Gets or sets a custom spell-checking dictionary.

CustomParser

Gets or sets a custom spell-checking parser.

Enabled

Gets a value that indicates whether the main spelling dictionary has been loaded.

IgnoreList

Gets the list of words to ignore during spell-checking.

MainDictionary

Gets the main dictionary used for spell-checking.

MaxWordLength

Gets or sets the maximum length of words that are spell-checked.

Options

Gets a SpellOptions object that specifies spell-checking options.

UserDictionary

Gets the user dictionary used for spell-checking.

Methods

Name Description
BeginInit()
CheckControl(ISpellCheckableEditor)

Shows a spell-checking dialog for an editor and returns the number of spelling errors found.

CheckControl(ISpellCheckableEditor, bool)

Shows a spell-checking dialog for an editor and returns the number of spelling errors found.

CheckControl(ISpellCheckableEditor, bool, ISpellDialog)

Shows a spell-checking dialog for an editor and returns the number of spelling errors found.

CheckControl(Control, object)

Shows a spell-checking dialog for a control which supports the IHtmlDocument2 interface, returns the number of spelling errors found.

CheckControl(Control, object, bool)

Shows a spell-checking dialog for a control which supports the IHtmlDocument2 interface, returns the number of spelling errors found.

CheckControl(Control, object, bool, ISpellDialog)

Shows a spell-checking dialog for a control which supports the IHtmlDocument2 interface, returns the number of spelling errors found.

CheckControl(TextBoxBase)

Shows a spell-checking dialog for an editor, returns the number of spelling errors found.

CheckControl(TextBoxBase, bool)

Shows a spell-checking dialog for an editor, returns the number of spelling errors found.

CheckControl(TextBoxBase, bool, ISpellDialog)

Shows a spell-checking dialog for an editor, returns the number of spelling errors found.

CheckControl(WebBrowser)

Shows a spell-checking dialog for a browser, returns the number of spelling errors found.

CheckControl(WebBrowser, bool)

Shows a spell-checking dialog for a browser, returns the number of spelling errors found.

CheckControl(WebBrowser, bool, ISpellDialog)

Shows a spell-checking dialog for a browser, returns the number of spelling errors found.

CheckText(string)

Checks a string containing text and returns a list of spelling errors.

CheckText(string, int)

Checks a string containing text and returns a list of spelling errors.

CheckText(string, int, int)

Checks a string containing text and returns a list of spelling errors.

CheckWord(string)

Checks a word to see if it's spelled correctly.

Dispose(bool)
EndInit()
GetActiveSpellChecking(ISpellCheckableRichEditor)

Gets whether the C1SpellChecker should highlight spelling mistakes as the user types on a given ISpellCheckableRichEditor.

GetActiveSpellChecking(Control)

Gets whether the C1SpellChecker should highlight spelling mistakes as the user types on a given Control.

GetActiveSpellChecking(TextBoxBase)

Gets whether the C1SpellChecker should highlight spelling mistakes as the user types on a given TextBoxBase.

GetSuggestions(string)

Gets an array containing suggestions for a misspelled word.

GetSuggestions(string, int)

Gets an array containing suggestions for a misspelled word.

OnAutoReplace(AutoReplaceEventArgs)

Raises the AutoReplace event.

OnBadWordFound(BadWordEventArgs)

Raises the BadWordFound event.

OnContextMenuCreated(ContextMenuEventArgs)

Raises the ContextMenuCreated event.

OnDictionaryChanged(EventArgs)

Raises the DictionaryChanged event.

OnShowSuggestions(SuggestionsEventArgs)

Raises the ShowSuggestions event.

SetActiveSpellChecking(ISpellCheckableRichEditor, bool)

Sets whether the C1SpellChecker should monitor a given ISpellCheckableRichEditor and highlight spelling mistakes.

SetActiveSpellChecking(Control, object, bool)

Sets whether the C1SpellChecker should highlight spelling mistakes in a WebBrowser control.

SetActiveSpellChecking(TextBoxBase, bool)

Sets whether the C1SpellChecker should highlight spelling mistakes as the user types on a given TextBoxBase.

SetActiveSpellChecking(WebBrowser, bool)

Sets whether the C1SpellChecker should highlight spelling mistakes in a WebBrowser control.

Events

Name Description
AutoReplace

Occurs before the C1SpellChecker makes an automatic replacement in the control's text.

BadWordFound

Occurs when a spelling error is found by the C1SpellChecker.

ContextMenuCreated

Occurs when a context menu is created containing the spelling suggestions and commands.

DictionaryChanged

Occurs when any of the spell dictionaries changes in any way.

ShowSuggestions

Occurs when suggestions is about to show in the spell dialog or in the spell context menu.