# Product Architecture

> How TX Spell .NET for Windows Forms is built: TXSpell.dll and TXSpell.Windows.Forms.dll, the language data folders, TextControl integration, NuGet packages.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for Windows Forms > Overview > Product Architecture
- **1619 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/architecture/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/architecture/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/architecture/llms-full.txt

---

Knowing how the parts of TX Spell .NET for Windows Forms fit together makes it easier to add it to a project and to deploy the result. The sections below describe the assemblies and classes, the language data they read, how TX Text Control and other controls use the spell checker, and what each NuGet package brings.

### How the Parts Fit

```text
 Windows Forms application
 ┌──────────────────────────────────────────────────────────────────┐
 │  TextControl ── SpellChecker ──►┐                                │
 │  RichTextBox / TextBox ─ Check ─►  TXSpellChecker                │
 │                                  (dialogs, menu items, events)   │
 │                                  TXSpell.Windows.Forms.dll       │
 │                                         │                        │
 │  Console, service, server ─────────►  TXSpell                    │
 │                                  (checking, suggestions,         │
 │                                   hyphenation, synonyms,         │
 │                                   language detection)            │
 │                                  TXSpell.dll                     │
 └─────────────────────────────────────────┬────────────────────────┘
                                           │ reads
     Dictionaries   HyphenationLists   SynonymLists   LanguageRecognition
```

TX Spell .NET has one engine, *TXSpell.dll*, shared by all its products, and one assembly with the user interface for each platform, here *TXSpell.Windows.Forms.dll*. Both read the language data from four folders next to the application.

### The Two Classes

|  | TXSpellChecker | TXSpell |
|---|---|---|
| Assembly | *TXSpell.Windows.Forms.dll* | *TXSpell.dll* |
| Namespace | `TXTextControl.Proofing` | `TXTextControl.Proofing` |
| What it is | A component, derived from `System.ComponentModel.Component`, on a form | A class for code |
| User interface | Spell check dialog, options dialog, context menu items | None |
| Events | For corrections, the dialog and the dictionaries | None |
| Connects to TX Text Control | To the `TextControl` of Windows Forms | Only to `ServerTextControl` |
| Initialization | Automatic when connected to a `TextControl`, otherwise `Create` | `Create` before first use |
| Package | `TXTextControl.TXSpell.WinForms.SDK` | `TXTextControl.TXSpell.Core.SDK`, and the Windows Forms package |

Both classes check text, create suggestions, hyphenate, find synonyms and detect languages with the same members, such as [Check](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/check-method/llms-full.txt), [CreateSuggestions](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/createsuggestions-method/llms-full.txt) and [GetHyphenationPoints](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/gethyphenationpoints-method/llms-full.txt). The classes of the language data, such as [OpenOfficeDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/openofficedictionary/llms-full.txt), [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) and [HyphenationList](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/hyphenationlist/llms-full.txt), are shared by both. [Components](https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/components/llms-full.txt) describes each part.

The texts of the dialogs are resources: English is built in, German comes as the satellite assembly *de\\TXSpell.resources.dll*, and [Localization and Resource Kit](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/localization/llms-full.txt) adds other languages.

### The Language Data

The spell checker reads its language data from four folders next to the application: *Dictionaries* for spell checking and suggestions, *HyphenationLists* for hyphenation, *SynonymLists* for synonyms and *LanguageRecognition* for language detection. The NuGet packages copy them with the US English data into the output directory when you build; [Installing Dictionaries and Language Data](https://docs.textcontrol.com/tx-spell-dotnet-winforms/installation/language-data/llms-full.txt) describes the folders, where the spell checker looks for them and how to keep them elsewhere.

### How TX Text Control Uses the Spell Checker

A `TextControl` gets its spell checker through its [SpellChecker](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/spellchecker-property/llms-full.txt) property. From then on, the editor drives the checking, and the spell checker answers:

1. The user types a word. When the word is complete, the `TextControl` asks the spell checker whether it is spelled correctly.
2. The `TextControl` underlines the misspelled words and keeps them in its [MisspelledWords](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/misspelledwords-property/llms-full.txt) collection, which holds the misspelled words of the part of the document with the input focus, such as the main text, a header or a text frame.
3. A right-click on an underlined word opens the spell check menu; the menu and the dialogs correct the word in the document.

[IsSpellCheckingEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/isspellcheckingenabled-property/llms-full.txt), [IsHyphenationEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/ishyphenationenabled-property/llms-full.txt) and [IsLanguageDetectionEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/islanguagedetectionenabled-property/llms-full.txt) of the `TextControl` switch the three services on. [As-You-Type Checking](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/as-you-type/llms-full.txt) describes the connection in detail.

### How Other Controls Use It

A `RichTextBox` or a `TextBox` doesn't know the spell checker. Your application does the work the `TextControl` does by itself:

1. It passes the text to [Check](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/check-method/llms-full.txt), which fills [IncorrectWords](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/incorrectwords-property/llms-full.txt) with the misspelled words and their positions.
2. It marks the words, or opens the spell check dialog for them.
3. It applies each correction the user makes in the [IncorrectWordChanging](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/incorrectwordchanging-event/llms-full.txt) event.

[Checking on Demand](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/on-demand/llms-full.txt) shows these steps with a `RichTextBox`.

### The NuGet Packages

Two NuGet packages bring the assemblies into a .NET project: `TXTextControl.TXSpell.WinForms.SDK` with *TXSpell.dll* and *TXSpell.Windows.Forms.dll*, and `TXTextControl.TXSpell.Core.SDK` with *TXSpell.dll* only. Both also bring the US English language data, the German texts and the license file, and neither depends on TX Text Control; [Package Overview](https://docs.textcontrol.com/tx-spell-dotnet-winforms/installation/nuget/packages/llms-full.txt) lists what each contains.

### One Spell Checker for Many Controls

One `TXSpellChecker` serves every `TextControl` and every other control of a form, and of other forms. The dictionaries are loaded once, and a word the user adds to a user dictionary is accepted in all editors at once. [Checking Multiple Controls](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/multiple-controls/llms-full.txt) shows how to share it and how one dialog checks several controls.

### Next Steps

- [Components](https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/components/llms-full.txt): what each part does.
- [Supported Platforms](https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/platforms/llms-full.txt): the .NET versions and tools.
- [Loading and Managing Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/dictionaries/managing/llms-full.txt): the dictionaries in code.
- [Getting Started](https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/llms-full.txt): a first application.

---

## Nearby

- **Previous:** [Introduction](https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/introduction/llms-full.txt)
- **Next:** [Components](https://docs.textcontrol.com/tx-spell-dotnet-winforms/overview/components/llms-full.txt)
