private void btnAdd_Click(object sender, EventArgs e) { frmNPCCharacterEquipmentEditor characterEquipmentEditor = new frmNPCCharacterEquipmentEditor(); if (characterEquipmentEditor.ShowDialog() == DialogResult.OK) { var equipment = characterEquipmentEditor.Equipment; equipments.Add(equipment); loadEquipments(); } }
private void btnModify_Click(object sender, EventArgs e) { var index = listView1.SelectedIndices[0]; listView1.Items.RemoveAt(index); equipments.RemoveAt(index); frmNPCCharacterEquipmentEditor characterEquipmentEditor = new frmNPCCharacterEquipmentEditor(); if (characterEquipmentEditor.ShowDialog() == DialogResult.OK) { var equipment = characterEquipmentEditor.Equipment; equipments.Insert(index, equipment); loadEquipments(); } }