public static void Add(IPresentationImage image) { Platform.CheckForNullReference(image, "image"); Platform.CheckForNullReference(image.ImageViewer, "image.ImageViewer"); // TODO (CR Phoenix5 - Med): Clinical as well if (!PermissionsHelper.IsInRole(AuthorityTokens.KeyImages)) { throw new PolicyException(SR.ExceptionCreateKeyImagePermissionDenied); } KeyImageInformation info = GetKeyImageInformation(image.ImageViewer); if (info == null) { throw new ArgumentException("The specified image's viewer is not valid.", "image"); } IImageSopProvider sopProvider = image as IImageSopProvider; if (sopProvider == null) { throw new ArgumentException("The image must be an IImageSopProvider.", "image"); } info.ClipboardItems.Add(ClipboardComponent.CreatePresentationImageItem(image)); }
public static void Show(IDesktopWindow desktopWindow, ShelfDisplayHint displayHint) { // TODO (CR Phoenix5 - Med): Clinical as well if (!PermissionsHelper.IsInRole(AuthorityTokens.KeyImages)) { throw new PolicyException(SR.ExceptionViewKeyImagePermissionDenied); } desktopWindow = desktopWindow ?? Application.ActiveDesktopWindow; IShelf shelf = GetClipboardShelf(desktopWindow); if (shelf != null) { shelf.Activate(); } else { Workspace activeWorkspace = desktopWindow.ActiveWorkspace; KeyImageInformation info = GetKeyImageInformation(activeWorkspace) ?? new KeyImageInformation(); ClipboardComponent component = new KeyImageClipboardComponent(info); shelf = ApplicationComponent.LaunchAsShelf(desktopWindow, component, SR.TitleKeyImages, displayHint); shelf.Closed += OnClipboardShelfClosed; ClipboardShelves[desktopWindow] = shelf; } }
internal static void OnViewerClosed(IImageViewer viewer) { KeyImageInformation info = GetKeyImageInformation(viewer); KeyImageInformation.Remove(viewer); if (info != null) { using (info) { try { var publisher = new KeyImagePublisher(info); publisher.Publish(); } catch (Exception e) { //Should never happen because KeyImagePublisher.Publish doesn't throw exceptions. ExceptionHandler.Report(e, Application.ActiveDesktopWindow); } } } ManageActivityMonitorConnection(); }
internal static void OnViewerOpened(IImageViewer viewer) { if (!KeyImageInformation.ContainsKey(viewer)) { KeyImageInformation[viewer] = new KeyImageInformation(); } ManageActivityMonitorConnection(); }
internal static void Launch(IDesktopWindow desktopWindow) { KeyImageInformation info = KeyImageClipboard.GetKeyImageInformation(desktopWindow); if (info == null) { throw new ArgumentException("There is no valid key image data available for the given window.", "desktopWindow"); } KeyImageInformationEditorComponent component = new KeyImageInformationEditorComponent(); component.Description = info.Description; component.DocumentTitle = info.DocumentTitle; component.SeriesDescription = info.SeriesDescription; ApplicationComponentExitCode exitCode = LaunchAsDialog(desktopWindow, component, SR.TitleEditKeyImageInformation); if (exitCode == ApplicationComponentExitCode.Accepted) { info.Description = component.Description; info.DocumentTitle = component.DocumentTitle; info.SeriesDescription = component.SeriesDescription; } }
public KeyImagePublisher(KeyImageInformation information) { _sourceInformation = information; _keyObjectDocuments = new List <DicomFile>(); }
public KeyImageClipboardComponent(KeyImageInformation keyImageInformation) : base(KeyImageClipboard.ToolbarSite, KeyImageClipboard.MenuSite, keyImageInformation.ClipboardItems, false) { _keyImageInformation = keyImageInformation; }