private void AddAccountButton_Click(object sender, EventArgs e) { AccountForm newAccount = new AccountForm(""); if (newAccount.ShowDialog() == System.Windows.Forms.DialogResult.OK) { BlueVex2.Properties.Settings.Default.Accounts.Add(newAccount.Username + "," + newAccount.Password + "," + newAccount.CharSlot + "," + newAccount.Master + "," + newAccount.Realm); PopulateAccountsListView(); } }
private void EditAccountButton_Click(object sender, EventArgs e) { if (this.AccountsListView.SelectedItems.Count > 0) { string itemString = this.AccountsListView.SelectedItems[0].Text + "," + this.AccountsListView.SelectedItems[0].SubItems[1].Text + "," + this.AccountsListView.SelectedItems[0].SubItems[2].Text + "," + this.AccountsListView.SelectedItems[0].SubItems[3].Text + "," + this.AccountsListView.SelectedItems[0].SubItems[4].Text; AccountForm newAccount = new AccountForm(itemString); if (newAccount.ShowDialog() == System.Windows.Forms.DialogResult.OK) { BlueVex2.Properties.Settings.Default.Accounts.Remove(itemString); BlueVex2.Properties.Settings.Default.Accounts.Add(newAccount.Username + "," + newAccount.Password + "," + newAccount.CharSlot + "," + newAccount.Master + "," + newAccount.Realm); PopulateAccountsListView(); } } }