public GetViewersResult GetViewers(GetViewersRequest request)
 {
     // Done for reasons of speed, as well as the fact that a call to the service from the same thread
     // that the service is hosted on (the main UI thread) will cause a deadlock.
     if (SynchronizationContext.Current == ViewerAutomationServiceHostTool.HostSynchronizationContext)
     {
         return new ViewerAutomation().GetViewers(request);
     }
     else
     {
         using (ViewerAutomationServiceClient client = new ViewerAutomationServiceClient())
         {
             return client.GetViewers(request);
         }
     }
 }
示例#2
0
 public GetViewersResult GetViewers(GetViewersRequest request)
 {
     // Done for reasons of speed, as well as the fact that a call to the service from the same thread
     // that the service is hosted on (the main UI thread) will cause a deadlock.
     if (SynchronizationContext.Current == ViewerAutomationServiceHostTool.HostSynchronizationContext)
     {
         return(new ViewerAutomation().GetViewers(request));
     }
     else
     {
         using (ViewerAutomationServiceClient client = new ViewerAutomationServiceClient())
         {
             return(client.GetViewers(request));
         }
     }
 }
示例#3
0
        public GetViewersResult GetViewers(GetViewersRequest request)
        {
            List<Viewer> viewers = new List<Viewer>();

            //The tool stores the viewer ids in order of activation, most recent first
            foreach (Guid viewerId in ViewerAutomationTool.GetViewerIds())
            {
                IImageViewer viewer = ViewerAutomationTool.GetViewer(viewerId);
                if (viewer != null && GetViewerWorkspace(viewer) != null)
                    viewers.Add(new Viewer(viewerId, GetPrimaryStudyIdentifier(viewer)));
            }

            if (viewers.Count == 0)
                throw new FaultException<NoViewersFault>(new NoViewersFault(), "No active viewers were found.");

            return new GetViewersResult {Viewers = viewers};
        }
示例#4
0
        public GetViewersResult GetViewers(GetViewersRequest request)
        {
            List <Viewer> viewers = new List <Viewer>();

            //The tool stores the viewer ids in order of activation, most recent first
            foreach (Guid viewerId in ViewerAutomationTool.GetViewerIds())
            {
                IImageViewer viewer = ViewerAutomationTool.GetViewer(viewerId);
                if (viewer != null && GetViewerWorkspace(viewer) != null)
                {
                    viewers.Add(new Viewer(viewerId, GetPrimaryStudyIdentifier(viewer)));
                }
            }

            if (viewers.Count == 0)
            {
                throw new FaultException <NoViewersFault>(new NoViewersFault(), "No active viewers were found.");
            }

            return(new GetViewersResult {
                Viewers = viewers
            });
        }
示例#5
0
 public GetViewersResult GetViewers(GetViewersRequest request)
 {
     return(Execute(a => a.GetViewers(request)));
 }
 public GetViewersResult GetViewers(GetViewersRequest request)
 {
     return(base.Channel.GetViewers(request));
 }