/// <summary> /// Publish the Message Available Event. /// </summary> /// <param name="messageAvailableEvent">Available message.</param> private void PublishMessageAvailableEvent(MessageAvailableEventArgs messageAvailableEvent) { // DisplayMessageDetails(messageAvailableEvent); if (OnMessageAvailable != null) { OnMessageAvailable(this, messageAvailableEvent); } }
/// <summary> /// Publish the Message Available Event. /// </summary> /// <param name="localActorName">Local Actor Name.</param> /// <param name="remoteActorName">Remote Actor Name.</param> /// <param name="message">Message.</param> /// <param name="direction">Message direction.></param> public void PublishMessageAvailableEvent(ActorName localActorName, ActorName remoteActorName, Message message, MessageDirectionEnum direction) { BaseMessage baseMessage = new BaseMessage(message, direction); MessageAvailableEventArgs messageAvailableEvent = new MessageAvailableEventArgs(localActorName, remoteActorName, baseMessage); if (OnMessageAvailable != null) { OnMessageAvailable(this, messageAvailableEvent); } }
private void DisplayMessageDetails(MessageAvailableEventArgs messageAvailableEvent) { String messageType = String.Empty; ActorName localActorName = messageAvailableEvent.LocalActorName; ActorName remoteActorName = messageAvailableEvent.RemoteActorName; if (messageAvailableEvent.Message.Message is DicomProtocolMessage) { DicomProtocolMessage dicomProtocolMessage = (DicomProtocolMessage)messageAvailableEvent.Message.Message; if (dicomProtocolMessage is AssociateRq) { messageType = "AssociateRq"; } else if (dicomProtocolMessage is AssociateAc) { messageType = "AssociateAc"; } else if (dicomProtocolMessage is AssociateRj) { messageType = "AssociateRj"; } else if (dicomProtocolMessage is Abort) { messageType = "AbortRq"; } else if (dicomProtocolMessage is ReleaseRq) { messageType = "ReleaseRq"; } else if (dicomProtocolMessage is ReleaseRp) { messageType = "ReleaseRp"; } else if (dicomProtocolMessage is DicomMessage) { messageType = "DICOM Message"; } if (messageAvailableEvent.Message.Direction == MessageDirectionEnum.MessageReceived) { System.Console.WriteLine("Local: {0} - Received Message: {1} - From Remote: {2}", localActorName.TypeId, messageType, remoteActorName.TypeId); } else { System.Console.WriteLine("Local: {0} - Sending Message: {1} - To Remote: {2} ", localActorName.TypeId, messageType, remoteActorName.TypeId); } } }
/// <summary> /// Publish the Message Available Event. /// </summary> /// <param name="messageAvailable">Available message.</param> private void PublishMessageAvailableEvent(MessageAvailableEventArgs messageAvailableEvent) { if (OnMessageAvailable != null) { OnMessageAvailable(this, messageAvailableEvent); } }
/// <summary> /// Message is available. /// </summary> /// <param name="server">Event source.</param> /// <param name="messageAvailableEvent">Message Available Event Details.</param> private void MessageIsAvailable(object server, MessageAvailableEventArgs messageAvailableEvent) { // Publish the event to any interested parties. PublishMessageAvailableEvent(messageAvailableEvent); }
/// <summary> /// Publish the Message Available Event. /// </summary> /// <param name="localActorName">Local Actor Name.</param> /// <param name="remoteActorName">Remote Actor Name.</param> /// <param name="message">Message.</param> /// <param name="direction">Message direction.></param> public void PublishMessageAvailableEvent(ActorName localActorName, ActorName remoteActorName, Message message, MessageDirectionEnum direction) { BaseMessage baseMessage = new BaseMessage(message, direction); MessageAvailableEventArgs messageAvailableEvent = new MessageAvailableEventArgs(localActorName, remoteActorName, baseMessage); if (OnMessageAvailable != null) { OnMessageAvailable(this, messageAvailableEvent); } }
/// <summary> /// Message is available. /// </summary> /// <param name="server">Event source.</param> /// <param name="messageAvailableEvent">Message Available Event Details.</param> private void MessageIsAvailable(object server, MessageAvailableEventArgs messageAvailableEvent) { // Publish the event to any interested parties. PublishMessageAvailableEvent(messageAvailableEvent); }
/// <summary> /// Publish the Message Available Event. /// </summary> /// <param name="messageAvailableEvent">Available message.</param> private void PublishMessageAvailableEvent(MessageAvailableEventArgs messageAvailableEvent) { // DisplayMessageDetails(messageAvailableEvent); if (OnMessageAvailable != null) { OnMessageAvailable(this, messageAvailableEvent); } }
private void DisplayMessageDetails(MessageAvailableEventArgs messageAvailableEvent) { String messageType = String.Empty; ActorName localActorName = messageAvailableEvent.LocalActorName; ActorName remoteActorName = messageAvailableEvent.RemoteActorName; if (messageAvailableEvent.Message.Message is DicomProtocolMessage) { DicomProtocolMessage dicomProtocolMessage = (DicomProtocolMessage)messageAvailableEvent.Message.Message; if (dicomProtocolMessage is AssociateRq) { messageType = "AssociateRq"; } else if (dicomProtocolMessage is AssociateAc) { messageType = "AssociateAc"; } else if (dicomProtocolMessage is AssociateRj) { messageType = "AssociateRj"; } else if (dicomProtocolMessage is Abort) { messageType = "AbortRq"; } else if (dicomProtocolMessage is ReleaseRq) { messageType = "ReleaseRq"; } else if (dicomProtocolMessage is ReleaseRp) { messageType = "ReleaseRp"; } else if (dicomProtocolMessage is DicomMessage) { messageType = "DICOM Message"; } if (messageAvailableEvent.Message.Direction == MessageDirectionEnum.MessageReceived) { System.Console.WriteLine("Local: {0} - Received Message: {1} - From Remote: {2}", localActorName.TypeId, messageType, remoteActorName.TypeId); } else { System.Console.WriteLine("Local: {0} - Sending Message: {1} - To Remote: {2} ", localActorName.TypeId, messageType, remoteActorName.TypeId); } } }
/// <summary> /// Only intereseted in Storage Commitment N-Event-Report Response messages. /// Signal the local N-Event-Report Response semaphore on receipt of this message type. /// </summary> /// <param name="server">Event source.</param> /// <param name="messageAvailableEvent">Message Available Event Details.</param> private void HandleStorageCommitmentNEventReportResponse(object server, MessageAvailableEventArgs messageAvailableEvent) { if (messageAvailableEvent.Message.Message is DicomProtocolMessage) { DicomProtocolMessage dicomProtocolMessage = (DicomProtocolMessage)messageAvailableEvent.Message.Message; if (dicomProtocolMessage is DvtkHighLevelInterface.Dicom.Messages.DicomMessage) { DvtkHighLevelInterface.Dicom.Messages.DicomMessage dicomMessage = (DvtkHighLevelInterface.Dicom.Messages.DicomMessage)dicomProtocolMessage; if (dicomMessage.CommandSet.DimseCommand == DvtkData.Dimse.DimseCommand.NEVENTREPORTRSP) { if (_storageCommitmentNEventReportResponseSemaphore != null) { _storageCommitmentNEventReportResponseSemaphore.Signal(); } } } } }
void wrapper_OnMessageAvailable(object server, MessageAvailableEventArgs messageAvailableEvent) { }