Beispiel #1
0
        /// <summary>
        ///     add the word to spelling list box
        /// </summary>
        /// <param name="word">The word to be added.</param>
        /// <created>art2m,5/12/2019</created>
        /// <changed>art2m,5/12/2019</changed>
        private void AddWordToListBox()
        {
            var word = this.cboWord.Text.Trim();

            if (!ValidationClass.ValidateSpellingWord(word))
            {
                this.SetButtonsEnabledState_AddToListButtonClicked();
                this.ChangeControlsBackgroundColors();

                return;
            }

            if (!this.AddWordToListBox(word))
            {
                return;
            }

            this.SetButtonsEnabledState_AddToListButtonClicked();
            this.ChangeControlsBackgroundColors();
            this.SetTabOrderAddWordToList();
            this.SetTabOrderAddNewWordButton();

            if (this.CheckListBoxForWord(word))
            {
                this.SetAddingWordProperties();
                return(false);
            }

            // If true found duplicate word.
            if (!this.CheckWordSpelling(word))
            {
                return(false);
            }

            this.lstWords.Items.Add(word);

            SpellingListClass.SpeakString(word);
            this.SetAddingWordProperties();

            return(true);
        }
Beispiel #2
0
        /// <summary>
        ///     Handles the Click event of the AddToListButton control. Adds a new spelling word to the new spelling list.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="EventArgs" /> instance containing the event data.</param>
        private void OnButtonAddWordToList_Click(object sender, EventArgs e)
        {
            var addWord = this.cboWord.Text.Trim();

            if (!ValidationClass.ValidateSpellingWord(addWord))
            {
                this.SetButtonsEnabledState_AddToListButtonClicked();
                this.ChangeControlsBackgroundColors();

                return;
            }

            if (!this.AddWordToListBox(addWord))
            {
                return;
            }

            this.SetButtonsEnabledState_AddToListButtonClicked();
            this.ChangeControlsBackgroundColors();
            this.SetTabOrderAddWordToList();
            this.SetTabOrderAddNewWordButton();
        }