/// <summary> /// Evenement quand on click sur le bouton Ajouter aux favoris /// </summary> private void BoutonAjouterAyxFavoris_MouseClick(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) { var jsr = new JsonResumeSerie(); jsr.Serialisation(odgv); MessageBox.Show("\"" + odgv.NomSerie + "\"" + " a bien était ajouté aux favoris"); } }
/// <summary> /// Evénement double click sur une cellule du DGV /// </summary> private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { if (affichageFilms) { var colonne = e.ColumnIndex; var ligne = e.RowIndex; if (e.RowIndex >= 0) { var doubleClick = dataGridView1[0, ligne].Value.ToString(); for (var i = 0; i < objetsDataGridView.Count; i++) { if (objetsDataGridView[i].Nom == doubleClick) { var jr = new JsonResumeFilm(objetsDataGridView[i].Id); var odgv = jr.creationDObjet(); var ar = new AffichageResumeFilm(odgv); ar.ShowDialog(); } } } } if (affichageSeries) { var colonne = e.ColumnIndex; var ligne = e.RowIndex; if (e.RowIndex >= 0) { var doubleClick = dataGridView1[0, ligne].Value.ToString(); for (var i = 0; i < objetsDataGridView.Count; i++) { if (objetsDataGridView[i].Nom == doubleClick) { var jrs = new JsonResumeSerie(objetsDataGridView[i].Id); var odgv = jrs.CreationObjet(); var ars = new AffichageResumeSerie(odgv); ars.ShowDialog(); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message); EcritureFichierErreur(ex.Message, ex.StackTrace); } }