private void btnMyProfile_Click(object sender, EventArgs e) { ProfileWindow newWindow = new ProfileWindow(Connection.loggedUserEmail); newWindow.StartPosition = FormStartPosition.Manual; newWindow.Location = new Point(this.Location.X, this.Location.Y); newWindow.Show(); this.Close(); }
private void EditProfileButton_Click(object sender, RoutedEventArgs e) { if (ProfileWindow == null) { ProfileWindow = new ProfileWindow(LoggedUser, this); } Application.Current.MainWindow = ProfileWindow; ProfileWindow.Show(); }
private void btnLogIn_Click(object sender, EventArgs e) { Packet logInPacket = new Packet(Packet.PacketType.LogIn, Connection.id); Connection.loggedUserEmail = tbEmail.Text; logInPacket.gData.Add(tbEmail.Text); logInPacket.gData.Add(tbPassword.Text); Connection.master.Send(logInPacket.ToBytes()); Thread.Sleep(500); if (Connection.isValidUser) { ProfileWindow newWindow = new ProfileWindow(Connection.loggedUserEmail); newWindow.StartPosition = FormStartPosition.Manual; newWindow.Location = new Point(this.Location.X, this.Location.Y); newWindow.Show(); this.Hide(); } else { MessageBox.Show(Connection.logInMessage); } }