Beispiel #1
0
        /// ********************************************************************************
        /// <summary>
        ///     Display input box for user to enter new user name.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">Instance containing the event data.</param>
        /// <created>art2m,5/17/2019</created>
        /// <changed>art2m,5/23/2019</changed>
        /// ********************************************************************************
        private void OnUserAddNewMenuItem_Click(object sender, EventArgs e)
        {
            SpellingPropertiesClass.UserName = string.Empty;

            using (var dlgInput = new UserCreateNewForm())
            {
                var dlgResult = dlgInput.ShowDialog();

                if (DialogResult.OK != dlgResult)
                {
                    return;
                }

                SpellingListClass.SpeakString("Hello " + SpellingPropertiesClass.UserName + "!");
            }

            AddNewUserToUserNameFile();

            this.SetControlsState_AfterUserSelectOrAddUser();
        }
Beispiel #2
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 #3
0
        /// <summary>
        ///     add the word to spelling list box. add word user entered in combo box
        /// to the 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 (string.IsNullOrEmpty(word))
            {
                this.SetButtonsEnabledState_AddToListButtonClicked();
                this.ChangeControlsBackgroundColors();

                return;
            }

            var spwc = new SpellingWordsCollection();

            bool has = spwc.Any(cus => names.Contains(cus.FirstName));

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

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

            this.lstWords.Items.Add(word);

            SpellingListClass.SpeakString(word);

            this.SetAddingWordProperties();

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

            return(true);
        }
        /// <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 bool AddWordToListBox(string word)
        {
            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);
        }
        /// <summary>
        ///     add the word to spelling list box. add word user entered in combo box
        /// to the 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 (string.IsNullOrEmpty(word))
            {
                this.SetButtonsEnabledState_AddToListButtonClicked();
                this.ChangeControlsBackgroundColors();

                return;
            }

            // Do not add word to list box if it all ready contains the word.
            if (this.CheckListBoxForWord(word))
            {
                this.SetAddingWordProperties();
                return;
            }

            // Validate word user is adding has correct spelling.
            if (!this.CheckWordSpelling(word))
            {
                return;
            }


            // say word to validate to user word is being added to the list box.
            SpellingListClass.SpeakString(word);

            this.SetAddingWordProperties();

            this.SetButtonsEnabledState_AddToListButtonClicked();
            this.ChangeControlsBackgroundColors();
            this.SetTabOrderAddWordToList();
            this.SetTabOrderAddNewWordButton();
        }
Beispiel #6
0
        /// <summary>
        ///     add the word to spelling list box. add word user entered in combo box
        /// to the 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 (string.IsNullOrEmpty(word))
            {
                this.SetButtonsEnabledState_AddToListButtonClicked();
                this.ChangeControlsBackgroundColors();

                return;
            }


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

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



            SpellingListClass.SpeakString(word);

            this.SetAddingWordProperties();

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