internal static void Remember(Account acc) { var existing = Accounts.FirstOrDefault(x => x.Id == acc.Id); if (existing != null) { Accounts.RemoveAll(x => x.Id == acc.Id); } Accounts.Add(acc); SaveAccounts(); RefreshCmb(); }
private void LoginBtn_Click(object sender, RoutedEventArgs e) { Properties.Settings.Default.LastId = IdBox.Text; Properties.Settings.Default.RemId = (bool)RememberIdBox.IsChecked; Properties.Settings.Default.RemPwd = (bool)RememberPwdBox.IsChecked; Properties.Settings.Default.Save(); var acc = new Account(); acc.Id = IdBox.Text; acc.Password = PwdBox.Password; if (RememberIdBox.IsChecked == true) { if (RememberPwdBox.IsChecked == false) acc.Password = null; Core.Remember(acc); } var param = ""; if(rag.IsChecked == true) { param = "1rag1"; }else if(sak.IsChecked == true) { param = "1sak1"; } Core.LaunchGame(acc.Id, acc.Password, param); }