public GetViewerInfoResult GetViewerInfo(GetViewerInfoRequest 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().GetViewerInfo(request);
			}
			else
			{
				using (ViewerAutomationServiceClient client = new ViewerAutomationServiceClient())
				{
					return client.GetViewerInfo(request);
				}
			} 
		}
		/// <summary>
		/// Gets additional studies, not including the primary one, for the given <see cref="Viewer"/>.
		/// </summary>
		public IList<string> GetViewerAdditionalStudies(Viewer viewer)
		{
			var request = new GetViewerInfoRequest();
			return _viewerAutomationClient.GetViewerInfo(request).AdditionalStudyInstanceUids;
		}
Exemple #3
0
		public GetViewerInfoResult GetViewerInfo(GetViewerInfoRequest request)
		{
			if (request == null)
			{
				string message = "The get viewer info request cannot be null.";
				Platform.Log(LogLevel.Debug, message);
				throw new FaultException(message);
			}

			if (request.Viewer == null || request.Viewer.Identifier.Equals(Guid.Empty))
			{
				string message = "A valid viewer id must be specified.";
				Platform.Log(LogLevel.Debug, message);
				throw new FaultException(message);
			}

			IImageViewer viewer = ViewerAutomationTool.GetViewer(request.Viewer.Identifier);
			if (viewer == null)
			{
				string message = String.Format("The specified viewer ({0}) was not found, " +
									"likely because it has already been closed by the user.", request.Viewer.Identifier);
				Platform.Log(LogLevel.Debug, message);

				throw new FaultException<ViewerNotFoundFault>(new ViewerNotFoundFault(message), _viewerNotFoundReason);
			}

			GetViewerInfoResult result = new GetViewerInfoResult();
			result.AdditionalStudyInstanceUids = GetAdditionalStudyInstanceUids(viewer);
			return result;
		}
Exemple #4
0
        /// <summary>
        /// Gets additional studies, not including the primary one, for the given <see cref="Viewer"/>.
        /// </summary>
        public IList <string> GetViewerAdditionalStudies(Viewer viewer)
        {
            var request = new GetViewerInfoRequest();

            return(_viewerAutomationClient.GetViewerInfo(request).AdditionalStudyInstanceUids);
        }
 public GetViewerInfoResult GetViewerInfo(GetViewerInfoRequest request)
 {
     return(base.Channel.GetViewerInfo(request));
 }