Пример #1
0
        private void Test5Difficile_Button_Click(object sender, EventArgs e)
        {
            try
            {
                TestProblemesPhysiques test = new TestProblemesPhysiques(true);
                TestDemonstration_Form testDemoPhysiques = new TestDemonstration_Form(test);

                this.Hide();

                if (testDemoPhysiques.ShowDialog() == DialogResult.OK)
                {
                    TestPhysique_Form testPhysiques = new TestPhysique_Form(test);

                    if (testPhysiques.ShowDialog() == DialogResult.OK)
                    {
                        this.Show();
                    }
                }

                else
                {
                    this.Show();
                }
            }

            catch (Exception)
            {
                MessageBox.Show("Une erreur est survenue lors de la génération du test…", "Erreur !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
Пример #2
0
        private void Test2Facile_Button_Click(object sender, EventArgs e)
        {
            try
            {
                TestAttentionConcentration test = new TestAttentionConcentration(false);
                TestDemonstration_Form     testDemoAttention = new TestDemonstration_Form(test);

                this.Hide();

                if (testDemoAttention.ShowDialog() == DialogResult.OK)
                {
                    TestAttention_Form testAttention = new TestAttention_Form(test);

                    if (testAttention.ShowDialog() == DialogResult.OK)
                    {
                        this.Show();
                    }
                }

                else
                {
                    this.Show();
                }
            }

            catch (Exception)
            {
                MessageBox.Show("Une erreur est survenue lors de la génération du test…", "Erreur !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }
Пример #3
0
        private void Test1Facile_Button_Click(object sender, EventArgs e)
        {
            try
            {
                // On crée le test qu’a choisi l’utilisateur
                // Et on crée le formulaire pour afficher la consigne et la démonstration du test
                TestPerceptionMemoire  test = new TestPerceptionMemoire(false);
                TestDemonstration_Form testDemoPerception = new TestDemonstration_Form(test);

                // Tant qu’on n’a pas fermé le formulaire de démonstration, on cache le formulaire de menu
                this.Hide();

                if (testDemoPerception.ShowDialog() == DialogResult.OK)
                {
                    // L’utilisateur veut jouer, on crée le formulaire de jeu
                    TestPerception_Form testPerception = new TestPerception_Form(test);

                    // Et on l’affiche
                    if (testPerception.ShowDialog() == DialogResult.OK)
                    {
                        this.Show();
                    }
                }

                else
                {
                    this.Show();
                }
            }

            catch (Exception)
            {
                MessageBox.Show("Une erreur est survenue lors de la génération du test…", "Erreur !", MessageBoxButtons.OK, MessageBoxIcon.Error);
                this.Close();
            }
        }