Exemple #1
0
 private void ChangeUserButton_Click(object sender, EventArgs e)
 {
     using (var login = new Login(true))
     {
         if (login.ShowDialog() == DialogResult.Cancel) return;
         currentUser = UserFactory.GetUser(Settings.Default.GameMode);
         currentUser.GetInfo(login.UserString, true);
         Settings.Default.UserId = currentUser.User_id.ToString(CultureInfo.InvariantCulture);
         Settings.Default.Username = currentUser.Username;
         Settings.Default.Save();
         LoadUserSettings();
         PlayersCheckedLbl.Text = @"0";
         ScoresAddedLbl.Text = @"0";
         UpdateDataGrid(Settings.Default.GameMode);
     }
 }
Exemple #2
0
 private void CheckUser()
 {
     using (var login = new Login(false))
     {
         if (login.ShowDialog() == DialogResult.Cancel)
         {
             Close();
         }
         currentUser = UserFactory.GetUser(Settings.Default.GameMode);
         currentUser.GetInfo(login.UserString, true);
         Settings.Default.UserId = currentUser.User_id.ToString(CultureInfo.InvariantCulture);
         Settings.Default.Username = currentUser.Username;
         Settings.Default.Save();
     }
     LoadUserSettings();
 }