Beispiel #1
0
 public void setUI(Word word)
 {
     _word = word;
     tbkWord.Text = word.Name;
     tbkMeaning.Text = word.Meaning;
     tbkSentence.Text = word.Sentence;
 }
Beispiel #2
0
 public void setPropertyOnPanel(WordPanel wpanel,Word word)
 {
     wpanel.setUI(word);
     wpanel.BorderBrush = wordPanel1.BorderBrush;
     wpanel.BorderThickness = wordPanel1.BorderThickness;
     wpanel.Width = 300;
 }
Beispiel #3
0
 public void initializeBackend(List<Word> wordList,Word word_)
 {
     isSynonymPopulated = false;
     WordList = wordList;
     CurrentWord = word_;
      myIterator = new WordListIterator(WordList);
 }
Beispiel #4
0
 public void setText(Word word_)
 {
     CurrentWord = word_;
     tblkWord.Text = CurrentWord.Name;
     tbMeaning.Text = CurrentWord.Meaning;
     populateSynonyms();
 }
Beispiel #5
0
        public void init(Word word, List<Word> wordList)
        {
            CurrentWord = word;
            UnMasteredWord = wordList;

            wordTab1.initializeBackend(UnMasteredWord,currentWord);
        }
Beispiel #6
0
 public void checkNAdd(Word word)
 {
     Word word2BChanged = new Word();
     if (WordList.Contains(word))
     {
         WordList.ElementAt<Word>(WordList.IndexOf(word)).AdditionalInfo = word.AdditionalInfo;
         WordDaoImpl dao = new WordDaoImpl();
         dao.updateNote(word);
     }
 }
Beispiel #7
0
        public void initializeUI(Word word)
        {
            Word = word.Name;
            Homophones hp = new Homophones();

            try
            {
                List<Word> stringList = hp.getHomonymsWords(Word);
            }
            catch(Exception e)
            {

            }
            xdgHomoPhones.ItemsSource = hp.getHomonymsForWord("accessory");
        }
Beispiel #8
0
        public void setWord(Word word)
        {
            WordPanel wordPanel = new WordPanel();

            if (stkWordDefinition.Children.Count == 1)
            {
                setPropertyOnPanel(wordPanel,word);
                stkWordDefinition.Children.Add(wordPanel);
            }
            else
            {
                stkWordDefinition.Children.RemoveRange(1, stkWordDefinition.Children.Count);
                setPropertyOnPanel(wordPanel, word);
                stkWordDefinition.Children.Add(wordPanel);

            }
        }
Beispiel #9
0
 public WordIterator()
 {
     InitializeComponent();
     tblSentence.Text = "";
     currentWord = new Word();
 }
Beispiel #10
0
 private void setText(Word word)
 {
     txtWord.Text = word.Name;
     txtMeaning.Text = word.Meaning;
     txtNote.Text = word.AdditionalInfo;
     tblSentence.Text = word.Sentence;
 }
Beispiel #11
0
 private Word getText()
 {
     Word editedWord = new Word();
     editedWord.Name = txtWord.Text.ToString();
     editedWord.Meaning = txtMeaning.Text.ToString();
     editedWord.AdditionalInfo = txtNote.Text;
     return editedWord;
 }
Beispiel #12
0
 private void chkBxIsMastered_Checked(object sender, RoutedEventArgs e)
 {
     currentWord = getText();
     wordDictionary.markWordAsMastered(currentWord);
     btnForward_Click(sender,e);
 }
Beispiel #13
0
 private void changeAvailableWords()
 {
     Word editedWord = new Word();
     editedWord = getText();
     wordDictionary.checkNAdd(editedWord);
 }
Beispiel #14
0
        public void Show(Word word)
        {
            currentWord = word;

            this.Show();
        }
Beispiel #15
0
 public void markWordAsMastered(Word currentWord)
 {
     WordDaoImpl dao = new WordDaoImpl();
     dao.updateNote(currentWord);
     UnMasteredWordList.Remove(currentWord);
 }
Beispiel #16
0
        public static Word text2Word(String text2word)
        {
            Word word = new Word();
            string copy = text2word;

            int firstCommaIndex = copy.IndexOf(",");

            string word2 = null;
            string meaning = null;
            string additionalMeaning = null;

            try
            {
                word2 = copy.Substring(0, firstCommaIndex);
                string wordMeaningPlusAdditionalInfo = copy.Substring(firstCommaIndex + 1);
                int additionalInfoIndex = wordMeaningPlusAdditionalInfo.IndexOf("@#");
                if (additionalInfoIndex != -1)
                {
                    meaning = copy.Substring(firstCommaIndex + 1, additionalInfoIndex);
                    additionalMeaning = wordMeaningPlusAdditionalInfo.Substring(additionalInfoIndex + 2);
                    additionalMeaning = additionalMeaning.Replace("\n","");
                    additionalMeaning = additionalMeaning.Replace("\r", "");
                }
                else
                {
                    meaning = copy.Substring(firstCommaIndex + 1);
                    additionalMeaning = null;
                }
            }
            catch (Exception e)
            {

            }

            if (word2 != null)
            {
                word.Name = word2;

                word.Meaning = meaning;
                word.AdditionalInfo = additionalMeaning;
            }
            return word;
        }
 public void Add(Word word)
 {
     meaningList.Add(word.Meaning);
 }