コード例 #1
0
ファイル: SearchWindow.cs プロジェクト: Laguland/AppDev
        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();
        }
コード例 #2
0
 private void EditProfileButton_Click(object sender, RoutedEventArgs e)
 {
     if (ProfileWindow == null)
     {
         ProfileWindow = new ProfileWindow(LoggedUser, this);
     }
     Application.Current.MainWindow = ProfileWindow;
     ProfileWindow.Show();
 }
コード例 #3
0
 public MainWindow(UserData user)
 {
     RoomResults   = new List <Room>();
     OpenWindows   = new List <GameWindow>();
     Replays       = new List <TupleModel <string, string> >();
     ProfileWindow = null;
     InitializeComponent();
     RoomsGrid.ItemsSource  = RoomResults;
     ReplayGrid.ItemsSource = Replays;
     LoggedUser             = user;
     _loggedIn   = true;
     DataContext = LoggedUser;
     UpdateAvatar(LoggedUser.AvatarPath);
     ReplayRequest();
 }
コード例 #4
0
        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);
            }
        }