protected override void Execute() { var report = _reportsViewerController.GetSelectedReports().FirstOrDefault(); if (report == null) { return; } var reportTemplates = _reportsViewerController.GetCustomReportTemplates(); var reports = _reportsViewerController.GetReports(); var groupNames = reports.OrderByDescending(b => b.Group).Select(a => a.Group).Distinct().ToList(); var taskTemplateIdProvider = new TaskTemplateIdProvider(); var viewModel = new AppendReportViewModel(report.Clone() as Report, _imageService, _reportsViewerController.GetSelectedProject(), groupNames, reportTemplates, taskTemplateIdProvider, true); var view = new AppendReportWindow(viewModel, null); viewModel.Window = view; var result = view.ShowDialog(); if (result != null && (bool)result) { _reportsViewerController.UpdateReports(new List <Report> { viewModel.Report }); } }
protected override void Execute() { var reports = _reportsViewerController.GetSelectedReports(); var message1 = "This action will remove the selected reports from the project"; var message2 = "Do you want to proceed?"; var response = MessageBox.Show(message1 + Environment.NewLine + Environment.NewLine + message2, PluginResources.Plugin_Name, MessageBoxButton.YesNo, MessageBoxImage.Question); if (response == MessageBoxResult.No) { return; } var removeIds = reports.Select(a => a.Id).ToList(); _reportsViewerController.RemoveReports(removeIds); }