Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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;
            }
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
        internal static void OnViewerOpened(IImageViewer viewer)
        {
            if (!KeyImageInformation.ContainsKey(viewer))
            {
                KeyImageInformation[viewer] = new KeyImageInformation();
            }

            ManageActivityMonitorConnection();
        }
Exemplo n.º 5
0
        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;
 }