コード例 #1
0
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            Vocabulay.SaveJson("voc.json");
            Frame rootFrame = Window.Current.Content as Frame;

            rootFrame.Navigate(typeof(vocabulary_intro), null);
        }
コード例 #2
0
 public studyVocabulary()
 {
     this.InitializeComponent();
     totalVoc = Vocabulay.getTotalVocabulary();
     pos      = 0;
     word     = Vocabulay.getWord(0);
     actBoxes();
 }
コード例 #3
0
 public testVocabulary()
 {
     this.InitializeComponent();
     total             = Vocabulay.getTotalVocabulary();
     word              = Vocabulay.getWord(act);
     meaningBox.Text   = word.meaning;
     totalWords.Text   = total.ToString() + " Words to test";
     numRemaining.Text = "Success";
 }
コード例 #4
0
 public vocabulary_intro()
 {
     this.InitializeComponent();
     Vocabulay.updateWords();
     if (Vocabulay.getTotalVocabulary() == 0)
     {
         Study.IsEnabled = false;
         Test.IsEnabled  = false;
     }
 }
コード例 #5
0
ファイル: addVoc.xaml.cs プロジェクト: DavidMuMi/LearnEnglish
        private void Back_Click(object sender, RoutedEventArgs e)
        {
            VocabularyWord word = new VocabularyWord(Word.Text, Definition.Text, Example.Text);

            Vocabulay.WordList.Add(word);
            Vocabulay.SaveJson("voc.json");
            Frame rootFrame = Window.Current.Content as Frame;

            rootFrame.Navigate(typeof(vocabulary_intro), null);
        }
コード例 #6
0
 private void next_Click(object sender, RoutedEventArgs e)
 {
     pos++;
     if (pos >= totalVoc)
     {
         pos = 0;
     }
     word = Vocabulay.getWord(pos);
     actBoxes();
 }
コード例 #7
0
        private void next_Click(object sender, RoutedEventArgs e)
        {
            total -= 1;
            act++;
            if (act >= Vocabulay.getTotalVocabulary())
            {
                Next.IsEnabled        = false;
                meaningBox.Background = new SolidColorBrush(Colors.White);
                Example.Background    = new SolidColorBrush(Colors.White);
                wordBox.Background    = new SolidColorBrush(Colors.White);
                GetAnswer.IsEnabled   = false;
                Check.IsEnabled       = false;
                numRemaining.Text     = exitos + " Successes out of " + act;
                totalWords.Text       = total.ToString() + " Words remaining";
                return;
            }
            if (total == 0)
            {
                meaningBox.Text     = "";
                Example.Text        = "";
                meaningBox.Text     = "";
                Next.IsEnabled      = false;
                Check.IsEnabled     = false;
                GetAnswer.IsEnabled = false;
                return;
            }
            word            = Vocabulay.getWord(act);
            Check.IsEnabled = true;
            meaningBox.Text = word.meaning;
            Example.Text    = "";

            numRemaining.Text     = exitos + " Successes out of " + act;
            totalWords.Text       = total.ToString() + " Words remaining";
            wordBox.Background    = new SolidColorBrush(Colors.White);
            wordBox.Text          = "";
            Next.IsEnabled        = false;
            meaningBox.Background = new SolidColorBrush(Colors.White);
            Example.Background    = new SolidColorBrush(Colors.White);
            wordBox.Background    = new SolidColorBrush(Colors.White);
        }
コード例 #8
0
 private void check_Click(object sender, RoutedEventArgs e)
 {
     if (word.word == wordBox.Text.ToString())
     {
         wordBox.Background    = new SolidColorBrush(Colors.Green);
         meaningBox.Background = new SolidColorBrush(Colors.Green);
         Example.Background    = new SolidColorBrush(Colors.Green);
         Vocabulay.WordList[act].updateSuccess(true);
         Example.Text = Vocabulay.getOneExample(act);
         exitos++;
         Check.IsEnabled     = false;
         GetAnswer.IsEnabled = false;
     }
     else
     {
         wordBox.Background    = new SolidColorBrush(Colors.Red);
         meaningBox.Background = new SolidColorBrush(Colors.Red);
         Example.Background    = new SolidColorBrush(Colors.Red);
         Vocabulay.WordList[act].updateSuccess(false);
     }
     Next.IsEnabled = true;
 }