public static EditeurPersonne getInstance() { if (uniqueInstance == null) { uniqueInstance = new EditeurPersonne(); } return(uniqueInstance); }
private void btModifier_Click(object sender, EventArgs e) { ListViewItemPersonne lviPers = (ListViewItemPersonne)(lstPersonnes.SelectedItems[0]); Personne p = lviPers.Qui; //EditeurPersonne edtPers = new EditeurPersonne(); EditeurPersonne edtPers = EditeurPersonne.getInstance(); edtPers.Modifier(p); edtPers.ShowDialog(this); if (edtPers.DialogResult == DialogResult.OK) { lviPers.changerNom(p.Nom); txtSalut.Text = p.Salut(); } else { MessageBox.Show("La modification a été annulée !", "Remarque", MessageBoxButtons.OK, MessageBoxIcon.Information); } }