Ejemplo n.º 1
0
        public void OpenTestClick()
        {
            QuestionSerialization serialization = new QuestionSerialization();
            OpenFileDialog        open          = new OpenFileDialog
            {
                Title  = "Opne test",
                Filter = "Test files |*.tst",
            };

            if (open.ShowDialog() == true)
            {
                testList = serialization.Deserialize2(open.FileName);
                foreach (var item in testList)
                {
                    var _rect = elements.Create();
                    ListBoxElements.Insert(ListBoxElements.Count - 1, _rect);

                    CountOfQuestions += 1;
                    CurrentQuestion   = ListBoxElements.Count - 1;
                    NotifyOfPropertyChange(() => GetCountOfQuestions);
                    var passedElement = (RectanlgeQuestions)ListBoxElements[CurrentQuestion - 1];
                    elements.TextInsideRct(ref passedElement, item.Question);

                    ClearScreen();
                    DeleteBothAnswer();
                }
            }
        }
Ejemplo n.º 2
0
        private void AddRectengle(object sender, RoutedEventArgs e)
        {
            var _rect = elements.Create();

            ListBoxElements.Insert(ListBoxElements.Count - 1, _rect);

            CountOfQuestions += 1;
            CurrentQuestion   = ListBoxElements.Count - 1;
            NotifyOfPropertyChange(() => GetCountOfQuestions);
            ClearScreen();
            DeleteBothAnswer();
        }