/// <summary> /// Handles the CellDoubleClick event of the gvReviews control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Forms.DataGridViewCellEventArgs"/> instance containing the event data.</param> private void gvReviews_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { try { var row = ReviewGrid.Rows[e.RowIndex]; var reviewId = int.Parse(row.Cells[Review.ColumnReviewId].Value.ToString()); bool itemFound = false; foreach (Project project in VisualStudioInstance.Solution.Projects) { VSIDEHelper.ScanForProjectItems(project, _reviewRepo.Get(reviewId), HandleProjectItem, out itemFound); if (itemFound) { return; } } if (!itemFound) { MessageBox.Show("Project item not found", Utils.AssemblyTitle, MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { Utils.HandleException(ex); } }
/// <summary> /// Handles the MouseDoubleClick event of the ReviewGrid control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.Windows.Input.MouseButtonEventArgs"/> instance containing the event data.</param> private void ReviewGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { try { Review review = (Review)((DataGrid)sender).SelectedItem; bool itemFound = false; foreach (Project project in VSIDEHelper.VisualStudioInstance.Solution.Projects) { VSIDEHelper.ScanForProjectItems(project, review, HandleProjectItem, out itemFound); if (itemFound) { return; } } if (!itemFound) { MessageBox.Show("Project item not found", Utils.AssemblyTitle); } } catch (Exception ex) { Utils.HandleException(ex); } }