Exemple #1
0
        /// <summary>
        /// Initialisation du moteur : on
        /// ouvre la fenêtre d'options puis
        /// on lance la fenêtre principale.
        /// 
        /// Comme c'est le moteur qui gère la boucle d'application,
        /// on peut se permettre de faire Exit() si nécessaire.
        /// </summary>
        public Moteur()
        {
            FenêtreOptions f = new FenêtreOptions(true);

            DialogResult d = f.ShowDialog();

            f.Dispose();

            if (d == DialogResult.OK)
            {
                this.erreurs = new Erreurs();

                this.fenêtre = new FenêtrePrincipale(this.erreurs);

                // Abonnement aux évènements fournis par l'IU
                this.fenêtre.DémarrerConversion    += Convertir;
                this.fenêtre.InterrompreConversion += Interrompre;

                Application.Run(this.fenêtre);
            }
            else
                Application.Exit();
        }
        private void UserRequest_OuvrirOptions(object sender, EventArgs e)
        {
            FenêtreOptions f = new FenêtreOptions();

            DialogResult d = f.ShowDialog();

            if (d == DialogResult.OK)
            {
                f.Dispose();
                ActualiserListe();
            }
        }