Esempio n. 1
0
        public MainForm()
        {
            InitializeComponent();

            ILoginPresenter loginPresenter = new LoginPresenter();

            mainPresenter = new MainPresenter();
            LoginForm loginForm = new LoginForm();

            loginPresenter.AttachView(loginForm);
            mainPresenter.AttachView(this);
            DialogResult loginResult = loginForm.ShowDialog();

            switch (loginResult)
            {
            case DialogResult.OK:
                mainPresenter.LoginSuccess(loginPresenter);
                break;

            case DialogResult.Cancel:
                MessageBox.Show("Ни хочиш нинада!!!111");
                this.Close();
                break;

            default:
                MessageBox.Show("WAT?");
                this.Close();
                break;
            }
        }