private void BtnPrev_Click(object sender, RoutedEventArgs e) { JapVerb verb = verbs.getPrev(); expanderTxtMasu.Text = verb.VerbMasuForm; expanderTxtKanji.Text = verb.VerbKanji; expanderTxtMeaning.Text = verb.VerbMeaning; resetTextBoxs(); }
private void BtnCheck_Click(object sender, RoutedEventArgs e) { JapVerb verb = verbs.currentVerb(); if (txtDictNameInput != null && txtTeFormInput != null) { if (txtDictNameInput.Text != verb.VerbDictionaryName) { txtDictNameInput.Foreground = Brushes.White; txtDictNameInput.Background = Brushes.Red; } else { txtDictNameInput.Foreground = Brushes.White; txtDictNameInput.Background = Brushes.LightGreen; } } if (txtTeFormInput.Text != verb.VerbTeform) { txtTeFormInput.Foreground = Brushes.White; txtTeFormInput.Background = Brushes.Red; } else { txtTeFormInput.Foreground = Brushes.White; txtTeFormInput.Background = Brushes.LightGreen; } if (txtNayiFormInput.Text != verb.VerbNayiForm) { txtNayiFormInput.Foreground = Brushes.White; txtNayiFormInput.Background = Brushes.Red; } else { txtNayiFormInput.Foreground = Brushes.White; txtNayiFormInput.Background = Brushes.LightGreen; } if (txtTaFormInput.Text != verb.VerbTaForm) { txtTaFormInput.Foreground = Brushes.White; txtTaFormInput.Background = Brushes.Red; } else { txtTaFormInput.Foreground = Brushes.White; txtTaFormInput.Background = Brushes.LightGreen; } }
public MainWindow() { InitializeComponent(); timer = new System.Timers.Timer(); timer.Interval = 1000; timer.Elapsed += Timer_Elapsed; JapVerb verb = verbs.currentVerb(); expanderTxtMasu.Text = verb.VerbMasuForm; expanderTxtKanji.Text = verb.VerbKanji; expanderTxtMeaning.Text = verb.VerbMeaning; expanderMasu.IsExpanded = true; }
private void Timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { Dispatcher.BeginInvoke(new Action(() => { counter--; if (counter == 0) { JapVerb verb = verbs.getNext(); expanderTxtMasu.Text = verb.VerbMasuForm; expanderTxtKanji.Text = verb.VerbKanji; expanderTxtMeaning.Text = verb.VerbMeaning; counter = 40; resetTextBoxs(); } btnStart.Content = counter + "秒"; })); }