private void btnEdit_Click(object sender, RoutedEventArgs e) { try { Review review = (Review)ReviewGrid.SelectedItem; if (review != null) { ReviewEditor = new ReviewEditor(_reviewRepo) { Owner = Window.GetWindow(this) }; ReviewEditor.SetReview(review); ReviewEditor.ShowDialog(); RefreshReviewList(); } else { MessageBox.Show("No current row to Edit", Utils.AssemblyTitle); } } catch (Exception ex) { Utils.HandleException(ex); } }
private void btnAdd_Click(object sender, RoutedEventArgs e) { try { if (VSIDEHelper.VisualStudioInstance.Solution.IsOpen) { if (VSIDEHelper.VisualStudioInstance.ActiveDocument != null) { ReviewEditor = new ReviewEditor(_reviewRepo) { Owner = Window.GetWindow(this) }; ReviewEditor.SetReview(null); ReviewEditor.ShowDialog(); RefreshReviewList(); } else { MessageBox.Show(NoFileOpen); } } else { MessageBox.Show(SolutionNotOpen); } } catch (Exception ex) { Utils.HandleException(ex); } }