예제 #1
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();
        }
예제 #2
0
        private void UpdateEnabled()
        {
            // TODO  Better way to address Webstation usage?
            base.Enabled = KeyImagePublisher.IsSupportedImage(base.SelectedPresentationImage) &&
                           // TODO (CR Phoenix5 - Med): Clinical as well
                           PermissionsHelper.IsInRole(AuthorityTokens.KeyImages) &&
                           // TODO (CR Phoenix5 - Low): KeyImagePublisher.IsSupportedImage?
                           !(SelectedPresentationImage.ParentDisplaySet.Descriptor is KeyImageDisplaySetDescriptor) &&
                           (WorkItemActivityMonitor.IsRunning || !KeyImageClipboard.HasViewPlugin);

            // TODO (CR Phoenix5 - Med): Clinical as well
            this.ShowEnabled = WorkItemActivityMonitor.IsRunning &&
                               PermissionsHelper.IsInRole(AuthorityTokens.KeyImages);
        }