private void SignUpButton_Click(object sender, RoutedEventArgs e) { // signUp _evArgs = new EventsArguments(); _evArgs.RunServer = (bool)ClientRadioButtonPlusServerRadioButton1.IsChecked; _evArgs.TypeAuthentication = (bool)RegistartionRadioButton.IsChecked ? TypeAuthentication.SignUp : TypeAuthentication.Login; _evArgs.NickName = NickNameTextBox.Text; _evArgs.Password = PasswordTextBox.Text; _evArgs.IpAdress = IpAdress.Text; OnSubmitForm(); }
private void ConnectOrCreateChat(object sender, EventsArguments e) { if (e.RunServer) { Thread ctThread = new Thread(Server.StartServer); ctThread.Start(); } _serverClientSide = new ServerClientSide(); _serverClientSide.SetUpServer(e.IpAdress, e.NickName, e.Password, e.TypeAuthentication); _clientChatThread = new Thread(GetMessage); _clientChatThread.Start(); NickNamelabel.Content = e.NickName; _authWindow.SubmitForm -= ConnectOrCreateChat; _authWindow.Close(); }