/// <summary> /// Add the given DicomClient using the Destination Actor Configuration. /// </summary> /// <param name="dicomClientType">Dicom Client Type.</param> /// <param name="toActorType">To Actor Type.</param> /// <param name="commonConfig">Common Configuration.</param> /// <param name="peerToPeerConfigCollection">Peer to Peer Configuration collection.</param> protected void AddDicomClient(DicomClientTypeEnum dicomClientType, ActorTypeEnum toActorType, CommonConfig commonConfig, BasePeerToPeerConfigCollection peerToPeerConfigCollection) { foreach (BasePeerToPeerConfig basePeerToPeerConfig in peerToPeerConfigCollection) { if ((basePeerToPeerConfig is DicomPeerToPeerConfig) && (basePeerToPeerConfig.FromActorName.TypeId == _actorName.TypeId) && (basePeerToPeerConfig.ToActorName.Type == toActorType)) { DicomClient dicomClient = ClientServerFactory.CreateDicomClient(dicomClientType, this, basePeerToPeerConfig.ToActorName); if (dicomClient != null) { dicomClient.ApplyConfig(commonConfig, (DicomPeerToPeerConfig)basePeerToPeerConfig); SubscribeEvent(dicomClient); _dicomClients.Add(dicomClient.ActorName.TypeId, dicomClient); // Initialize the connection with the to actor as being active. // - this can always be overruled by the application later. SetActorDefaultConnectionActive(basePeerToPeerConfig.ToActorName); } } } }