private void btnAdd_Click(object sender, EventArgs e) { //Create dialog object and display modal dialog frmSlotDialog addDialog = new frmSlotDialog(); addDialog.ShowDialog(); if (addDialog.DialogResult == DialogResult.OK) { addSlot(addDialog.Slot); } parseArray(); }
private void btnCopy_Click(object sender, EventArgs e) { if (lstSlots.SelectedIndex == -1) { return; } //Create dialog object and display modal dialog frmSlotDialog cpyDialog = new frmSlotDialog((Slot)lstSlots.SelectedItem); cpyDialog.ShowDialog(); if (cpyDialog.DialogResult == DialogResult.OK) { addSlot(cpyDialog.Slot); } parseArray(); }
private void btnEdit_Click(object sender, EventArgs e) { int index = lstSlots.SelectedIndex; if (index == -1) { return; } Slot selectedSlot = (Slot)lstSlots.SelectedItem; frmSlotDialog editDialog = new frmSlotDialog(new Slot((Slot)lstSlots.SelectedItem)); editDialog.ShowDialog(); if (editDialog.DialogResult == DialogResult.OK) { deleteSlot(selectedSlot); addSlot(editDialog.Slot); } parseArray(); }