Ejemplo n.º 1
0
        private void AddAccountButton_Click(object sender, EventArgs e)
        {
            try
            {
                APIAccount account = RiotAPI.GetAccountFromUrl <APIAccount>(serverCombobox.Text, nameTextbox.Text);

                if (mainForm.accountPuuids.Contains(account.Puuid))
                {
                    MessageBox.Show("Account already added");
                    return;
                }

                AccountListHandler.addAccountToServer(new Account(account, null, usernameTextbox.Text, passwordTextbox.Text, serverCombobox.Text), mainForm);
                mainForm.accountPuuids.Add(account.Puuid);

                mainForm.updateAccounts();
                mainForm.changeServer(serverCombobox.SelectedIndex);

                this.Dispose();
            }
            catch (Exception)
            {
                MessageBox.Show("An error has occured");
            }
        }
Ejemplo n.º 2
0
 private void loadAccounts()
 {
     try
     {
         foreach (Account account in AccountSerializer.getAllAccounts())
         {
             AccountListHandler.addAccountToServer(account, this);
         }
     }
     catch (Exception) { }
 }