public TestView(QuestionStorage storage) { InitializeComponent(); _storage = storage; _questions = storage.Questions.Shuffle() .Select(q => new TestQuestion(q)) .ToList(); GoTo(0); App.Log.WriteLine("Начался тест " + storage.Name); }
private void Button_Click_1(object sender, RoutedEventArgs e) { string fileName = (string) fileNames.SelectedItem; if (fileName == null) return; fileName = Path.Combine(QuestionStorage.QuestionDirectory, fileName); try { var questions = new QuestionStorage(); questions.Load(fileName); App.Log.WriteLine(string.Format("Загружено {0} вопросов", questions.Questions.Count)); App.MainWindow.Transition(new TestView(questions)); } catch (Exception ex) { App.Log.WriteException(ex); return; } }
private void Button_Click_1(object sender, RoutedEventArgs e) { string fileName = (string)fileNames.SelectedItem; if (fileName == null) { return; } fileName = Path.Combine(QuestionStorage.QuestionDirectory, fileName); try { var questions = new QuestionStorage(); questions.Load(fileName); App.Log.WriteLine(string.Format("Загружено {0} вопросов", questions.Questions.Count)); App.MainWindow.Transition(new TestView(questions)); } catch (Exception ex) { App.Log.WriteException(ex); return; } }