Ejemplo n.º 1
0
        public MainWindow()
        {
            i = 1;
            InitializeComponent();
            WindowStartupLocation   = System.Windows.WindowStartupLocation.CenterScreen;
            colorSetter.ItemsSource = colorList;
            Login.Visibility        = Visibility.Visible;
            learningMode            = new LearningMode();
            testMode = new TestMode();

            Baza = Baza.GetInstance();

            Refresh();
        }
Ejemplo n.º 2
0
        public QuestionsRandomize(string[] categoryTab, int _value)
        {
            this.value = _value;

            #region select 10 random words if category was checked in SetTestMode page
            if (categoryTab[0] != null)
            {
                tabFruitsPolish  = new string[10];
                tabFruitsEnglish = new string[10];
                RandomWords(0, tabFruitsPolish, tabFruitsEnglish, categoryTab);
            }

            if (categoryTab[1] != null)
            {
                tabAnimalsPolish  = new string[10];
                tabAnimalsEnglish = new string[10];
                RandomWords(1, tabAnimalsPolish, tabAnimalsEnglish, categoryTab);
            }

            if (categoryTab[2] != null)
            {
                tabAppearancePolish  = new string[10];
                tabAppearanceEnglish = new string[10];
                RandomWords(2, tabAppearancePolish, tabAppearanceEnglish, categoryTab);
            }

            if (categoryTab[3] != null)
            {
                tabProfessionsPolish  = new string[10];
                tabProfessionsEnglish = new string[10];
                RandomWords(3, tabProfessionsPolish, tabProfessionsEnglish, categoryTab);
            }
            #endregion

            #region if some category wasn't checked in SetTestMode, initialize array as an empty array
            if (categoryTab[0] == null)
            {
                tabFruitsPolish  = new string[0];
                tabFruitsEnglish = new string[0];
            }
            if (categoryTab[1] == null)
            {
                tabAnimalsPolish  = new string[0];
                tabAnimalsEnglish = new string[0];
            }
            if (categoryTab[2] == null)
            {
                tabAppearancePolish  = new string[0];
                tabAppearanceEnglish = new string[0];
            }
            if (categoryTab[3] == null)
            {
                tabProfessionsPolish  = new string[0];
                tabProfessionsEnglish = new string[0];
            }
            #endregion

            string[] tabPolish  = CombineTab(tabAnimalsPolish, tabFruitsPolish, tabAppearancePolish, tabProfessionsPolish);
            string[] tabEnglish = CombineTab(tabAnimalsEnglish, tabFruitsEnglish, tabAppearanceEnglish, tabProfessionsEnglish);

            TestMode testMode = new TestMode(value, tabPolish, tabEnglish);
            Application.Current.MainWindow.Content = testMode;
        }