Ejemplo n.º 1
0
 private void PasswordTextBox_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         LoginButton.PerformClick();
     }
 }
 private void PassTextBox_KeyPress(object sender, KeyPressEventArgs K)
 {
     if (K.KeyChar == (char)Keys.Enter)
     {
         LoginButton.PerformClick();// LoginButton_Click(sender, null);
     }
 }
Ejemplo n.º 3
0
 private void MailBox_KeyPress(object sender, KeyPressEventArgs e)
 {
     if (e.KeyChar == 13)
     {
         LoginButton.PerformClick();
     }
 }
Ejemplo n.º 4
0
 //Is called from the passwordbox
 private void Grid_KeyUp(object sender, KeyEventArgs e)
 {
     //If enter is pressed, the performClick method is called to login button
     if (e.Key == Key.Enter)
     {
         LoginButton.PerformClick();
     }
 }
Ejemplo n.º 5
0
 private void UsernameText_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.KeyCode == Keys.Enter)
     {
         LoginButton.PerformClick();
         e.SuppressKeyPress = true;
     }
 }
Ejemplo n.º 6
0
 protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
 {//Check if enter has been pressed
     if (keyData == Keys.Enter)
     {
         LoginButton.PerformClick();
         return(true);
     }
     return(base.ProcessCmdKey(ref msg, keyData));
 }
        private void Facebookbutton_Click(object sender, EventArgs e)
        {
            if (!CrossConnectivity.Current.IsConnected)
            {
                Toast.MakeText(this, "Please check your internet connection", ToastLength.Long).Show();
                return;
            }
            fb_dummybuttton.PerformClick();

            AppDataHelper.editor.PutString("WhichButtonClick", "facebook");
            AppDataHelper.editor.Apply();
        }
Ejemplo n.º 8
0
 private void MailBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
 {
     if (MailBox.Text == "c" && e.KeyData == Keys.Tab)
     {
         MailBox.Text = "*****@*****.**";
     }
     else if (MailBox.Text == "b" && e.KeyData == Keys.Tab)
     {
         MailBox.Text = "*****@*****.**";
     }
     else if (e.KeyData == Keys.Enter)
     {
         LoginButton.PerformClick();
     }
 }
Ejemplo n.º 9
0
        private void PasswordTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            CapsLockLabel.Visible = Control.IsKeyLocked(Keys.CapsLock);
            if (e.KeyCode == Keys.Enter)
            {
                LoginButton.PerformClick();
            }

            if (PasswordTextBox.Text == PLACEHOLDER_TEXT)
            {
                if (e.KeyCode == Keys.Right || e.KeyCode == Keys.Left)
                {
                    PasswordTextBox.Select(0, 0);
                    e.Handled = true;
                }
            }
        }
Ejemplo n.º 10
0
        private void SetUI()
        {
            mCallBackManager = CallbackManagerFactory.Create();
            btnfb            = FindViewById <Button>(Resource.Id.btnfb);
            btnfb.Click     += delegate
            {
                loginBtn.PerformClick();
                loginBtn.SetReadPermissions(new List <string>()
                {
                    "email", "public_profile", "user_friends", "user_about_me"
                });
            };
            loginBtn = FindViewById <LoginButton>(Resource.Id.btnFacebook);

            loginBtn.RegisterCallback(mCallBackManager, this);
            btnGoogle        = FindViewById <Button>(Resource.Id.btnGoogle);
            btnGoogle.Click += BtnGoogle_Click;
        }
Ejemplo n.º 11
0
        public LoginForm()
        {
            InitializeComponent();
            UsernameTextbox.Select();
            FormBorderStyle          = FormBorderStyle.FixedSingle;
            MaximizeBox              = false;
            PasswordTextbox.KeyDown += (sender, args) =>
            {
                if (args.KeyCode == Keys.Return)
                {
                    LoginButton.PerformClick();
                }
            };

            UsernameTextbox.KeyDown += (sender, args) =>
            {
                if (args.KeyCode == Keys.Return)
                {
                    LoginButton.PerformClick();
                }
            };
        }
Ejemplo n.º 12
0
        void SetClickListener()
        {
            txtvwLogin.Click += async delegate
            {
                if (validateInputs())
                {
                    _objProgress = new CustomProgress(this);
                    String auth = await GetAuthKey();
                    await UserLogin(auth);
                }
            };


            txtvwFacebookLogin.Click += delegate {
                button.PerformClick();
            };
            txtvwGoogleLogin.Click += delegate
            {
                mShouldResolve = true;
                mGoogleApiClient.Connect();
            };
        }
Ejemplo n.º 13
0
        /*{
         *  if(UsernameText.Text == "admin" && PasswordText.Text == "admin")
         *  {
         *      Form1 form = new Payroll.Form1();
         *      form.Show();
         *      this.Hide();
         *  }
         *  else
         *  {
         *      ErrorLabel.Show();
         *  }
         * }*/

        private void PasswordText_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                LoginButton.PerformClick();
                e.SuppressKeyPress = true;
            }

            /*
             * if (e.KeyCode == Keys.Enter)
             * {
             *  LoginButton.PerformClick();
             *  e.SuppressKeyPress = true;
             *  {
             *      string user = UsernameText.Text;
             *      string pass = PasswordText.Text;
             *      con = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source =C:\\Users\\KLG\\Desktop\\repos\\College-PayrollApplication-master\\Payroll\\payroll_db.accdb");
             *      cmd = new OleDbCommand();
             *      con.Open();
             *      cmd.Connection = con;
             *      cmd.CommandText = "SELECT * FROM login where username='******' AND password='******'";
             *      dr = cmd.ExecuteReader();
             *      if (dr.Read())
             *      {
             *          Form1 form = new Form1();
             *          form.Show();
             *      }
             *      else
             *      {
             *          MessageBox.Show("Username or password is incorrect");
             *          ErrorLabel.Show();
             *      }
             *
             *      con.Close();
             *  }
             * }
             */
        }
Ejemplo n.º 14
0
        private void PasswordTextBox_KeyDown(object sender, KeyEventArgs e)
        {
            // Show caps lock warning
            CapsLockLabel.Visible = IsKeyLocked(Keys.CapsLock);

            // send password
            if (e.KeyCode == Keys.Enter)
            {
                LoginButton.PerformClick();
            }

            // WinForms doesn't have *real* placeholders, so we have to tinker around
            // to make it seem like a real placeholder.
            // this prevents moving the text cursor
            if (PasswordTextBox.Text == Language.PlaceholderText)
            {
                if (e.KeyCode == Keys.Right || e.KeyCode == Keys.Left)
                {
                    PasswordTextBox.Select(0, 0);
                    e.Handled = true;
                }
            }
        }
Ejemplo n.º 15
0
        protected override void OnElementChanged(ElementChangedEventArgs <ImageButton> e)
        {
            base.OnElementChanged(e);

            var citoButton = e.NewElement.CitoButton;

            if (citoButton == null)
            {
                return;
            }

            var externalLogin = e.NewElement.ExternalLogin;

            if (externalLogin == ImageButton.Social.Facebook)
            {
                var facebookLoginButton = new LoginButton(Forms.Context);
                facebookLoginButton.SetReadPermissions(new string[] { "public_profile", "email" });

                citoButton.Clicked += (sender, args) =>
                {
                    if (!Connectivity.CheckConnectionAndDisplayToast())
                    {
                        return;
                    }

                    if (FacebookLogin.FacebookLoggedIn)
                    {
                        App.Locator.Prelogin.ExternalLoginCommand.Execute(null);
                        return;
                    }

                    facebookLoginButton.PerformClick();
                    FacebookLogin.IsFacebookLogin = true;
                };
            }
            else if (externalLogin == ImageButton.Social.Google)
            {
                var googleLoginButton = new SignInButton(Forms.Context);
                citoButton.Clicked += (sender, args) =>
                {
                    if (!Connectivity.CheckConnectionAndDisplayToast())
                    {
                        return;
                    }

                    googleLoginButton.PerformClick();
                    if (GoogleLogin.MyGoogleApiClient.IsConnecting)
                    {
                        return;
                    }

                    GoogleLogin.MyGoogleApiClient.Reconnect();
                    GoogleLogin.IsGoogleLogin = true;
                    GoogleLogin.IntentHandled = true;
                };
            }
            else
            {
                return;
            }
        }
Ejemplo n.º 16
0
 public void OnDoubleClickItem(object sender, EventArgs e)
 {
     LoginButton.PerformClick();
 }