Пример #1
0
        private void ButtonLogin_Click(object sender, EventArgs e)
        {
            EditText editTextPass = FindViewById <EditText>(Resource.Id.editTextPassLogin);

            editTextPass.SetTextColor(Color.White);

            if (VotingsUser.Login(editTextPass.Text))
            {
                CreateVotingSettingStatisticTabs();
            }
            else
            {
                editTextPass.SetTextColor(Color.OrangeRed);
            }
        }
Пример #2
0
        private void ButtonReg_Click(object sender, EventArgs e)
        {
            EditText editTextPublicKey  = FindViewById <EditText>(Resource.Id.editTextPublicKeyReg);
            EditText editTextPrivateKey = FindViewById <EditText>(Resource.Id.editTextPrivateKeyReg);
            EditText editTextPass1      = FindViewById <EditText>(Resource.Id.editTextPassReg);
            EditText editTextPass2      = FindViewById <EditText>(Resource.Id.editTextPass2Reg);


            editTextPass1.SetTextColor(Color.White);
            editTextPass2.SetTextColor(Color.White);
            editTextPublicKey.SetTextColor(Color.White);
            editTextPrivateKey.SetTextColor(Color.White);


            if (!CommonHelpers.CheckKeys(editTextPublicKey.Text, editTextPrivateKey.Text))
            {
                editTextPublicKey.SetTextColor(Color.OrangeRed);
                editTextPrivateKey.SetTextColor(Color.OrangeRed);
            }
            else if (editTextPass1.Text != editTextPass2.Text)
            {
                editTextPublicKey.SetTextColor(Color.OrangeRed);
                editTextPrivateKey.SetTextColor(Color.OrangeRed);
            }
            else
            {
                VotingsUser.ClearUserData();
                VotingsUser.Register(editTextPublicKey.Text, editTextPrivateKey.Text, editTextPass1.Text);
                VotingsUser.GetKeysFromConfig();

                if (VotingsUser.Login(editTextPass1.Text))
                {
                    CreateVotingSettingStatisticTabs();
                }
            }
        }