private void btnInvite_Click(object sender, EventArgs e) { if (lbUsers.SelectedItem != null && tabC_Dialogs.SelectedTab != null && tabC_Dialogs.SelectedTab.Text != "") { ServerCommands.InviteToDialog(tabC_Dialogs.SelectedTab.Text, lbUsers.SelectedItem.ToString()); } }
private void btnSendMessage_Click(object sender, EventArgs e) { if (txtMessage.Text != "") { if (privateDialog == false) { if (ClientAPI.Ban == false) { ServerCommands.SendMessage(Parent.Name, ClientAPI.Login, txtMessage.Text); string str = "[" + ClientAPI.Login + "] : " + txtMessage.Text; messages.Add(str); lbMessages.Items.Add(str); } else { MessageBox.Show("You are banned from this server! Try again latter please!", "Error!"); } } else { ServerCommands.SendPrivateMessage(Parent.Name, txtMessage.Text); string str = "[" + ClientAPI.Login + "] : " + txtMessage.Text; messages.Add(str); lbMessages.Items.Add(str); } txtMessage.Clear(); newMessage = 0; } }
private void MenuHandler(object sender, EventArgs e) { switch ((string)((ToolStripItem)sender).Text) { case "CreateDialog": if (ClientAPI.Ban == false) { new CreateMyDialog().Show(); } else { MessageBox.Show("You are banned from this server! Try again latter please!", "Error!"); } break; case "My dialogs": ShowMyDialogs(); break; case "All dialogs": RequestShowAllDialogs(); break; case "Show online users": RequestShowOnlineUsers(); break; case "Log Out/Exit": ServerCommands.LogOut(ClientAPI.Login); Close(); LogOut = true; authorization.Show(); break; case "Save dialog": collectionOfDialogsView.GetSelectedDialogView(tabC_Dialogs.SelectedTab.Text).SaveDialog(tabC_Dialogs.SelectedTab.Text); break; case "Change password": new ChangePassword().Show(); break; default: break; } }
private void btnChangePassword_Click(object sender, EventArgs e) { if (txtOldPass.Text != "" && txtNewPass.Text != "") { ServerCommands.ChangePassword(txtNewPass.Text); Close(); } }
private void btnSend_Click(object sender, EventArgs e) { if (txtLogin.Text != "" && txtEmail.Text != "") { ServerCommands.ForgotPassword(txtLogin.Text, txtEmail.Text); Close(); } }
private void btnToComeIn_Click(object sender, EventArgs e) { if (lbDialogs.SelectedItem != null) { ServerCommands.ToComeIn_TheDialog(lbDialogs.SelectedItem.ToString(), ClientAPI.Login); CreateDialogWhereImComeIn(lbDialogs.SelectedItem.ToString()); } }
private void btnFaceBook_Click(object sender, EventArgs e) { ExternalAuth auth = new ExternalAuth(); string[] info = auth.Facebook_Auth(); string name = auth.Tr(info[0]); string login = auth.Tr(info[1]); ServerCommands.AuthorizationWithFaceBook(name, login); }
private void btnGoogle_Click(object sender, EventArgs e) { ExternalAuth auth = new ExternalAuth(); string[] info = auth.Google_Auth(); string name = info[0]; string login = info[1]; ServerCommands.AuthorizationWithGoogle(name, login); }
public void CloseDialog(bool privateDialog) { if (privateDialog == false) { ServerCommands.CloseDialog(tabC_Dialogs.SelectedTab.Name, ClientAPI.Login); } collectionOfDialogsView.DeleteDialog(tabC_Dialogs.SelectedTab.Name); collectionOfTabPages.DeletePage(tabC_Dialogs.SelectedTab.Name); tabC_Dialogs.TabPages.Remove(tabC_Dialogs.SelectedTab); }
private void btnSignUP_Click(object sender, EventArgs e) { if (txtLogin.Text != "Put your login" && txtName.Text != "Put your name" && txtPass.Text != "Put your password" && txtLogin.Text != "" && txtName.Text != "" && txtPass.Text != "") { ServerCommands.SingUP(txtName.Text, txtLogin.Text, txtPass.Text); } else { MessageBox.Show("Please put correct information in fields", "Error"); } }
private void btnLogin_Click(object sender, EventArgs e) { if (txtLogin.Text == "" || txtLogin.Text == "Put your login") { MessageBox.Show("Please, put your natural login.", "Error!"); } else { ServerCommands.Authorization(txtLogin.Text, txtPass.Text); } }
private void btnShow_Click(object sender, EventArgs e) { lbBanUsers.Items.Clear(); if (users == "BannedUsers") { ServerCommands.ShowBannedUsers(); } else if (users == "AllUsers") { ServerCommands.ShowAllUsersForAdmin(); } else { lbBanUsers.Items.Add(users); } }
private void btnBan_Click(object sender, EventArgs e) { if (txtTime.Text != "" && cbTimeValue.SelectedItem != null) { string time = ""; switch (cbTimeValue.SelectedItem.ToString()) { case "minutes": time = Convert.ToString(DateTime.Now.AddMinutes(Convert.ToDouble(txtTime.Text))); break; case "days": time = Convert.ToString(DateTime.Now.AddDays(Convert.ToDouble(txtTime.Text))); break; case "weeks": time = Convert.ToString(DateTime.Now.AddDays(Convert.ToDouble(txtTime.Text) * 7)); break; case "months": time = Convert.ToString(DateTime.Now.AddMonths(Convert.ToInt32(txtTime.Text))); break; case "years": time = Convert.ToString(DateTime.Now.AddYears(Convert.ToInt32(txtTime.Text))); break; case "forever": time = "forever"; break; default: break; } ServerCommands.Ban(lbBanUsers.SelectedItem.ToString(), time); } }
private void RequestShowOnlineUsers() { ServerCommands.ShowOnlineUsers(ClientAPI.Login); }
private void RequestShowAllDialogs() { ServerCommands.ShowAllDialogs(ClientAPI.Login); }
private void btnOK_Click(object sender, EventArgs e) { mainWindow.CreateDialog(txtNameDialog.Text, false); ServerCommands.CreateDialog(ClientAPI.Login, txtNameDialog.Text); Close(); }
private void btnUnban_Click(object sender, EventArgs e) { ServerCommands.Unban(lbBanUsers.SelectedItem.ToString()); }