Exemple #1
0
        static void Main()
        {
            // Zorgt ervoor dat de applicatie werkt op HiDPI-schermen
            if (Environment.OSVersion.Version.Major >= 6)
                SetProcessDPIAware();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            MasterController MasterController = new MasterController(); //Aanmaken van MasterController, het hoofdscherm
            // Login dialog laten zien en wachten op resultaat.
            LoginView LoginView = new LoginView((LoginController)MasterController.GetController(typeof(LoginController)));
            if (LoginView.ShowDialog() == DialogResult.OK) //Als login dialog OK returnt dan MasterController uitvoeren
            {
                //MasterController runnen als hoofdapplicaties
                Application.Run(MasterController);
            }
            else
            {
                //Als login dialog iets anders dan OK returnt dan sluit hij de applicatie af, dus o.a. bij sluiten
                Application.Exit();
            }
        }
Exemple #2
0
        public void Logout()
        {
            this.User = null;
            this.Visible = false;
            this.ActiveParentContainer = null;

            //Application.Restart();

            LoginView LoginView = new LoginView((LoginController)this.GetController(typeof(LoginController)));
            if (LoginView.ShowDialog() == DialogResult.OK) //Als login dialog OK returnt dan MasterController uitvoeren
            {
                this.Visible = true;
            }
            else
            {
               Application.Exit();
            }
        }