Exemple #1
0
        private static void Screen_Login(object sender, LoginEventArgs e)
        {
            System.Threading.Thread.Sleep(2000);

            e.Success = (e.Username == "admin" & e.Password == "admin");

            if (!e.Success)
                e.FailureMessage = "Take the hint.";
        }
Exemple #2
0
        private void DoLogin()
        {
            if (!string.IsNullOrWhiteSpace(usernameTextBox.Text))
            {
                Console.CursorVisible = false;

                progressBar.Visible = true;

                var args = new LoginEventArgs(Username, Password);

                OnLogin(args);

                progressBar.Visible = false;

                if (args.Success)
                    return;

                failureLabel.Visible = true;
                failureLabel.Text = args.FailureMessage;
            }

            Password = string.Empty;

            Draw();
            Paint();

            passwordTextBox.Focus();
        }
Exemple #3
0
 protected virtual void OnLogin(LoginEventArgs args)
 {
     if (Login != null)
         Login(this, args);
 }