protected virtual void OnAfterSelect(BookSelectedEventArgs e) { if (onAfterSelect != null) { onAfterSelect(this, e); } }
private void dataGridViewBooks_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { // return if column header row is clicked int rowIndex = e.RowIndex; if (rowIndex == -1) { return; } int bookId = Convert.ToInt32(this.dataGridViewBooks.Rows[rowIndex].Cells["ID"].Value); // Raise the event if (onAfterSelect != null) { BookSelectedEventArgs bookSelectedEventArgs = new BookSelectedEventArgs(bookId); onAfterSelect(this, bookSelectedEventArgs); } }
private void bookList_AfterSelect(object sender, BookSelectedEventArgs e) { //MessageBox.Show(String.Format("Book #{0} selected!", e.BookId), "AfterSelect", // MessageBoxButtons.OK, MessageBoxIcon.Information); }