private void CreateRegisterLoginTabs() { ActionBar.RemoveAllTabs(); var tabReg = ActionBar.NewTab(); tabReg.SetText(Resource.String.register); tabReg.TabSelected += TabReg_TabSelected; var tabLogin = ActionBar.NewTab(); tabLogin.SetText(Resource.String.login); if (VotingsUser.CheckUserExists()) { VotingsUser.GetKeysFromConfig(); tabLogin.TabSelected += TabLogin_TabSelected; ActionBar.AddTab(tabLogin); ActionBar.AddTab(tabReg); tabLogin.Select(); } else { tabLogin.TabSelected += (s, e) => { }; ActionBar.AddTab(tabReg); ActionBar.AddTab(tabLogin); tabReg.Select(); } }
private void CheckBoxCreateBlocks_Click(object sender, EventArgs e) { CheckBox checkBoxCreateBlocks = FindViewById <CheckBox>(Resource.Id.checkBoxCreateBlocks); VotingsUser.CreateOwnBlocks = checkBoxCreateBlocks.Checked; VotingsUser.ChangeSetting("createOwnBlocks", checkBoxCreateBlocks.Checked.ToString()); }
private void EditTextTrackers_TextChanged(object sender, EventArgs e) { EditText editTextTrackers = FindViewById <EditText>(Resource.Id.editTextTrackers); VotingsUser.Trackers = editTextTrackers.Text; VotingsUser.ChangeSetting("trackers", editTextTrackers.Text.ToString()); }
private void CheckBoxDiscovery_Click(object sender, EventArgs e) { CheckBox checkBoxDiscovery = FindViewById <CheckBox>(Resource.Id.checkBoxPeerDiscovery); VotingsUser.PeerDiscovery = checkBoxDiscovery.Checked; VotingsUser.ChangeSetting("peerDiscovery", checkBoxDiscovery.Checked.ToString()); }
private void CheckBoxLocalIP_Click(object sender, EventArgs e) { CheckBox checkBoxLocalIP = FindViewById <CheckBox>(Resource.Id.checkBoxUseLanLocalIP); VotingsUser.UseLanLocalIP = checkBoxLocalIP.Checked; VotingsUser.ChangeSetting("useLanLocalIP", checkBoxLocalIP.Checked.ToString()); }
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); } }
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(); } } }