private void OnMultipleImageExportComplete(Exception error) { if (error != null) { this.Host.DesktopWindow.ShowMessageBox(SR.MessageExportFailed, MessageBoxActions.Ok); } _multipleImageExporter = null; }
private void Export() { if (SelectedImageExporter == null) { throw new InvalidOperationException("No exporter was chosen; unable to export any images."); } if (NumberOfImagesToExport == 1) { EventResult result = EventResult.Success; AuditedInstances exportedInstances = GetInstancesForAudit(ItemsToExport, this.ExportFilePath); try { if (!Directory.Exists(Path.GetDirectoryName(ExportFilePath ?? ""))) { throw new FileNotFoundException("The specified export file path does not exist: " + ExportFilePath ?? ""); } ClipboardItem clipboardItem = (ClipboardItem)_itemsToExport[0]; ExportImageParams exportParams = GetExportParams(clipboardItem); SelectedImageExporter.Export((IPresentationImage)clipboardItem.Item, ExportFilePath, exportParams); } catch (Exception ex) { result = EventResult.SeriousFailure; Platform.Log(LogLevel.Error, ex); } finally { AuditHelper.LogExportStudies(exportedInstances, EventSource.CurrentUser, result); } } else { if (!Directory.Exists(ExportFilePath ?? "")) { throw new FileNotFoundException("The specified export directory does not exist." + ExportFilePath ?? ""); } _multipleImageExporter = new MultipleImageExporter(this); _multipleImageExporter.Run(); } }