private void onAddAccount(object sender, EventArgs e) { CsvAccount account = new CsvAccount(); CsvAccountEditDialog dlg = new CsvAccountEditDialog(mManager, account); if (dlg.ShowDialog() == DialogResult.OK) { account = dlg.getAccount(); if (account != null) { mManager.AddAccount(account); updateList(); } } }
private void onModifyAccount(object sender, EventArgs e) { int idx = listBox.SelectedIndex; if (idx >= 0) { CsvAccount account = mManager.GetAt(idx); CsvAccountEditDialog dlg = new CsvAccountEditDialog(mManager, account); if (dlg.ShowDialog() == DialogResult.OK) { account = dlg.getAccount(); if (account != null) { mManager.ModifyAccount(account); updateList(); } } } }