Exemplo n.º 1
0
        public void LoginLoop()
        {
            using (FormLogin loginForm = new FormLogin())
            {
                do
                {
                    loginForm.ShowDialog(this);
                } while (loginForm.DialogResult == DialogResult.OK && (!loginForm.ReturnUser?.isAuthenticated ?? true));

                if (!(loginForm.DialogResult == DialogResult.OK))
                {
                    this.Close();
                }

                activeUser = loginForm.ReturnUser;
            }

            if (activeUser == null)
            {
                Environment.Exit(1);
            }

            using (FormSelectProject SelectProjectForm = new FormSelectProject())
            {
                DialogResult result;
                do
                {
                    result = SelectProjectForm.ShowDialog();
                } while (result != DialogResult.OK);

                currentProject = SelectProjectForm.SelectedProject;
            }

            if (currentProject == null)
            {
                Environment.Exit(1);
            }


            preferences.SetPreference(activeUser.UserName, currentProject.Name, currentProject.Name);

            this.SetText();
        }
Exemplo n.º 2
0
        public void LoginLoop()
        {
            using (FormLogin tmp = new FormLogin())
            {
                do
                {
                    tmp.ShowDialog(this);
                } while (tmp.DialogResult == DialogResult.OK && (!tmp.ReturnUser?.isAuthenticated ?? true));

                if (!(tmp.DialogResult == DialogResult.OK))
                {
                    this.Close();
                }
                else
                {
                    tmp.Text = "Main - No Project Selected";
                }

                activeUser = tmp.ReturnUser;
            }
        }