private void AnswersDemo_TextChanged(object sender, TextChangedEventArgs e) { if (AnswerList.SelectedIndex < 0) { TestsDemo.Clear(); AnswersDemo.IsEnabled = false; return; } TestFilesButtons.Check(); }
private void TestsWindowSave_Click(object sender, RoutedEventArgs e) { if (TestList.SelectedIndex != -1) { var test = Tests[TestList.SelectedIndex]; if (test != null) { File.WriteAllText(test, TestsDemo.Text); } } if (AnswerList.SelectedIndex != -1) { var answer = Answers[AnswerList.SelectedIndex]; if (answer != null) { File.WriteAllText(answer, AnswersDemo.Text); } } TestFilesButtons.Check(); }
private void TestsWindowCancel_Click(object sender, RoutedEventArgs e) { TestsDemo.Text = SelectedTest; AnswersDemo.Text = SelectedAnswer; TestFilesButtons.Check(); }