/// <summary>
 /// Raises the dict init.
 /// </summary>
 /// <param name="args">The <see cref="ActiveUp.WebControls.SpellChecking.DictInitEventArgs"/> instance containing the event data.</param>
 protected void RaiseDictInit(DictInitEventArgs args)
 {
     if (DictInitialization != null)
     {
         DictInitialization(this, args);
     }
 }
        /// <summary>
        /// get all words from dictionary
        /// </summary>
        public void GetAllWords()
        {
            DictInitEventArgs args = new DictInitEventArgs(DictInitLangugeEnum.LangEnglish);

            switch (Convert.ToInt32(this.WorkLanguge))
            {
            case 2:
            {
                args = new DictInitEventArgs(DictInitLangugeEnum.LangSpanish);
                break;
            }

            case 3:
            {
                args = new DictInitEventArgs(DictInitLangugeEnum.LangFrench);
                break;
            }

            case 4:
            {
                args = new DictInitEventArgs(DictInitLangugeEnum.LangGerman);
                break;
            }

            case 5:
            {
                args = new DictInitEventArgs(DictInitLangugeEnum.LangDutch);
                break;
            }
            }
            this.RaiseDictInit(args);
#if (LOG)
            if (this.logFileWriter == null)
            {
                this.logFileWriter = new StreamWriter(this.LogFileName);
            }
            this.logFileWriter.Write("Used " + this.DictPath + " dictionary file\r\n");
#endif
            StreamReader words = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + this.DictionaryFile);
            while (words.Peek() != -1)
            {
                string stringToAdd = words.ReadLine();

                if (stringToAdd.Length != 1)
                {
                    if (stringToAdd.Length > 0)
                    {
                        if (this.allWords.Contains(stringToAdd.Substring(0, 2)))
                        {
                            this.allWords[stringToAdd.Substring(0, 2)] += ' ' + stringToAdd;
                        }


                        else
                        {
                            if (!this.allWords.Contains(stringToAdd.Substring(0, 2)))
                            {
                                this.allWords.Add(stringToAdd.Substring(0, 2), stringToAdd);
                            }
                        }
                    }
                }
                else
                {
                    //if (stringToAdd.TrimEnd() != string.Empty && allWords[stringToAdd] != null)
                    if (!this.allWords.Contains(stringToAdd))
                    {
                        this.allWords.Add(stringToAdd, stringToAdd);
                    }
                }
            }

            words.Close();
        }