public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    ValidationManagementComponent component = new ValidationManagementComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        "UI Validation Management");
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
        public void Launch()
        {
            if (_workspace == null)
            {
                try
                {
                    var component = new EnumerationSummaryComponent();

                    _workspace = ApplicationComponent.LaunchAsWorkspace(
                        this.Context.DesktopWindow,
                        component,
                        SR.TitleEnumerationAdmin);
                    _workspace.Closed += delegate { _workspace = null; };
                }
                catch (Exception e)
                {
                    // could not launch component
                    ExceptionHandler.Report(e, this.Context.DesktopWindow);
                }
            }
            else
            {
                _workspace.Activate();
            }
        }
示例#3
0
        public OpenStudiesResult OpenStudies(OpenStudiesRequest request)
        {
            if (request == null)
            {
                string message = "The open studies request cannot be null.";
                Platform.Log(LogLevel.Debug, message);
                throw new FaultException(message);
            }

            if (request.StudiesToOpen == null || request.StudiesToOpen.Count == 0)
            {
                string message = "At least one study must be specified.";
                Platform.Log(LogLevel.Debug, message);
                throw new FaultException(message);
            }

            OpenStudiesResult result = new OpenStudiesResult();
            bool activateIfOpen      = request.ActivateIfAlreadyOpen ?? true;

            try
            {
                string       primaryStudyInstanceUid = request.StudiesToOpen[0].StudyInstanceUid;
                IImageViewer viewer = null;
                if (activateIfOpen)
                {
                    Workspace workspace = GetViewerWorkspace(primaryStudyInstanceUid);
                    if (workspace != null)
                    {
                        viewer = ImageViewerComponent.GetAsImageViewer(workspace);
                        workspace.Activate();
                    }
                }

                if (viewer == null)
                {
                    viewer = LaunchViewer(request, primaryStudyInstanceUid);
                }

                Guid?viewerId = ViewerAutomationTool.GetViewerId(viewer);
                if (viewerId == null)
                {
                    throw new FaultException("Failed to retrieve the id of the specified viewer.");
                }

                result.Viewer = new Viewer(viewerId.Value, GetPrimaryStudyIdentifier(viewer));
                return(result);
            }
            catch (FaultException)
            {
                throw;
            }
            catch (Exception e)
            {
                string message = "An unexpected error has occurred while attempting to open the study(s).";
                Platform.Log(LogLevel.Error, e, message);
                throw new FaultException(message);
            }
        }
示例#4
0
        private static bool ActivateIfAlreadyOpen(ReportingWorklistItem item)
        {
            Workspace workspace = DocumentManager.Get <ProtocollingComponentDocument>(item.OrderRef);

            if (workspace != null)
            {
                workspace.Activate();
                return(true);
            }
            return(false);
        }
示例#5
0
 /// <summary>
 /// Default clickHandler implementation for <see cref="MenuAction"/> and/or <see cref="ButtonAction"/> attributes.
 /// These attributes must be specified on subclasses.
 /// </summary>
 public void Launch()
 {
     if (Workspace == null)
     {
         Open();
     }
     else
     {
         Workspace.Activate();
     }
 }
        public static void Show(IDesktopWindow desktopWindow)
        {
            if (_workspace != null)
            {
                _workspace.Activate();
                return;
            }

            if (!PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.View))
            {
                desktopWindow.ShowMessageBox(SR.WarningActivityMonitorPermission, MessageBoxActions.Ok);
                return;
            }

            var component = new ActivityMonitorComponent();

            _workspace         = ApplicationComponent.LaunchAsWorkspace(desktopWindow, component, SR.TitleActivityMonitor);
            _workspace.Closed += ((sender, args) =>
            {
                _workspace = null;
            });
        }