Ejemplo n.º 1
0
        private void AddNewWord()
        {
            NewWordText = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(NewWordText.ToLower());
            IWord word = _dao.CreateNewWord();

            word.Text     = NewWordText;
            word.Language = SelectedDictionary.Language;
            SelectedDictionary.Words.Add(word);
            SelectedDictionaryWords.Add(word);
            SavedMessage = "";
            SelectedWord = word;
        }
Ejemplo n.º 2
0
 private bool CanAddNewWord()
 {
     if (SelectedDictionary == null || SelectedDictionaryWords == null)
     {
         return(false);
     }
     if (String.IsNullOrEmpty(NewWordText))
     {
         return(false);
     }
     if (SelectedDictionary.Words.Any(x => x.Text.Equals(NewWordText, StringComparison.OrdinalIgnoreCase)))
     {
         return(false);
     }
     if (NewWordText.Any(x => !Char.IsLetter(x)))
     {
         return(false);
     }
     return(true);
 }