Пример #1
0
        public LoginForm()
        {
            InitializeComponent();

            newUserPanel = new LoginNewUserPanel();
            newUserPanel.Visible = false;
            newUserPanel.Location = new System.Drawing.Point(10, 100);
            Controls.Add(newUserPanel);

            existingUserPanel = new LoginExistingUserPanel();
            existingUserPanel.Visible = false;
            existingUserPanel.Location = new System.Drawing.Point(10, 100);
            Controls.Add(existingUserPanel);

            successPanel = new LoginSuccessPanel();
            successPanel.Visible = false;
            successPanel.Location = new System.Drawing.Point(10, 100);
            Controls.Add(successPanel);

            welcomePanel.ActionSelected += new LoginWelcomePanel.ActionSelectedDelegate(welcomePanel_ActionSelected);
            newUserPanel.ActionSelected += new LoginNewUserPanel.ActionSelectedDelegate(newUserPanel_ActionSelected);
            existingUserPanel.ActionSelected += new LoginExistingUserPanel.ActionSelectedDelegate(existingUserPanel_ActionSelected);
        }
Пример #2
0
        // handle actions triggered by the new user panel
        void newUserPanel_ActionSelected(LoginNewUserPanel.Action action)
        {
            newUserPanel.Visible = false;

            switch (action) {
                case LoginNewUserPanel.Action.BACK:
                    welcomePanel.Visible = true;
                    break;
                case LoginNewUserPanel.Action.VALIDATED:
                    successPanel.Visible = true;
                    ValidatedUser = newUserPanel.ValidatedUser;
                    break;
            }
        }