Ejemplo n.º 1
0
        public ActionResult GetWord(string wordId)
        {
            var    manager = new WordsManager();
            Words  word    = manager.GetWord(wordId);
            string result  = word == null ? "" : word.Answer;

            return(Content(result));
        }
Ejemplo n.º 2
0
 public void GetWord(Word word = null)
 {
     thread = Thread.CurrentThread;
     if (word == null)
     {
         word = wordsManager.GetWord(isPreventWord);
     }
     isPreventWord = false;
     if (word != null)
     {
         Application.Current.Dispatcher.Invoke(() =>
         {
             WordWindow wordWindow       = new WordWindow();
             WordViewModel wordViewModel = wordWindow.DataContext as WordViewModel;
             wordViewModel.WordEvent     = word;
             wordWindow.ShowDialog();
             if (wordViewModel.EditingWord != null)
             {
                 EditWordEvent = wordViewModel.EditingWord;
                 OnPropertyChanged("EditWordEvent");
                 mainWindow.Show();
                 thread.Suspend();
             }
             isPreventWord = wordViewModel.PreviousWordEvent;
         });
         try
         {
             GetWord();
         }
         catch (Exception ex)
         {
             Loger.Write(ex.Message);
         }
     }
     try
     {
         wordsManager.Save();
         Thread.Sleep(config.SleepBetweenShows * 1000);
         wordsManager.GetNextWordsList();
         GetWord();
     }
     catch (Exception ex)
     {
         Loger.Write(ex.Message);
     }
 }