private void AddUserToolStripMenuItem_Click(object sender, EventArgs e) { NewAccount na = new NewAccount(false); if (na.ShowDialog() == DialogResult.OK && na.ActionResult != null) { Users.Add(na.ActionResult); listView1_Refresh(); AccountsLoader.Save(Users); } }
private void EditUsertoolStripMenuItem_Click(object sender, EventArgs e) { if (this.listViewUsers.SelectedIndices.Count < 1) return; NewAccount na = new NewAccount(true) { User = Users[listViewUsers.SelectedIndices[0]] }; if (na.ShowDialog() == DialogResult.OK && na.ActionResult != null) { //accounts.Add(na.accountresult); Users[listViewUsers.SelectedIndices[0]].Username = na.ActionResult.Username; Users[listViewUsers.SelectedIndices[0]].Password = na.ActionResult.Password; Users[listViewUsers.SelectedIndices[0]].Server = na.ActionResult.Server; Users[listViewUsers.SelectedIndices[0]].Description = na.ActionResult.Description; listView1_Refresh(); AccountsLoader.Save(Users); } }