Ejemplo n.º 1
0
        public TestView(QuestionStorage storage)
        {
            InitializeComponent();

            _storage   = storage;
            _questions = storage.Questions.Shuffle()
                         .Select(q => new TestQuestion(q))
                         .ToList();

            GoTo(0);

            App.Log.WriteLine("Начался тест " + storage.Name);
        }
Ejemplo n.º 2
0
        public TestView(QuestionStorage storage)
        {
            InitializeComponent();

            _storage = storage;
            _questions = storage.Questions.Shuffle()
                .Select(q => new TestQuestion(q))
                .ToList();

            GoTo(0);

            App.Log.WriteLine("Начался тест " + storage.Name);
        }
Ejemplo n.º 3
0
        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;
            }
        }
Ejemplo n.º 4
0
        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;
            }
        }