Пример #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Parametres.debug = "no"; // par défaut

            int retour = 0;

            frm_Splash splash = new frm_Splash();
            retour = splash.chargement(); // si retour == 0, alors les données de connexions sont ok
            splash.Close();
            if (retour != 0)
            {
                assistantConfig assistant = new assistantConfig();
                assistant.ShowDialog();
                // on relance une fois le splash, et en cas d'échec, on quitte
                splash = new frm_Splash();
                retour = splash.chargement();
                splash.Close();
                if (retour != 0)
                {
                    this.Close();
                }

            }

            if (Parametres.debug == "all")
            {
                MainForm.writeLog("mainForm.cs->load : chargement de la configuration terminé");
            }

            // timer pour mettre à jour la base de données quand le logiciel est actif (tab_computer.lastetat)
            timer_MAJEtat.Interval = 5000; 
            timer_MAJEtat.Tick += new EventHandler(timer_MAJEtat_Tick);
            timer_MAJEtat.Start();
        }
Пример #2
0
        void menuItem_Click(object sender, EventArgs e)
        {
            if (Parametres.debug == "all")
            {
                MainForm.writeLog("mainForm.cs->menuItem_Click");
            }
            ToolStripItem menuItem = (ToolStripItem)sender;
            if (menuItem.Name == "Parametres")
            {
                assistantConfig assistant = new assistantConfig();
                assistant.ShowDialog();
                if (Parametres.poste_type == "usager")
                {
                    goFullscreen(true);
                }
                if (Parametres.poste_type == "animateur")
                {
                    goFullscreen(false);
                }

            }
            if (menuItem.Name == "FinSession")
            {
                if (frmTemps != null) {
                    if (Parametres.poste_type == "usager")
                    {
                        goFullscreen(true);
                    }
                    if (Parametres.poste_type == "animateur")
                    {
                        goFullscreen(false);
                    }
                    frmTemps.Close();
                }
            }
            if (menuItem.Name == "Quitter")
            {
                Fonction.blocageGestionnaireDesTaches(false);
                Fonction.blocageChangementMotDePasse(false);
                this.Close();
            }
        }