コード例 #1
0
        /// <summary>
        /// Add the given DicomServer using the Destination Actor Configuration.
        /// </summary>
        /// <param name="dicomServerType">Dicom Server Type.</param>
        /// <param name="fromActorType">From Actor Type.</param>
        /// <param name="commonConfig">Common Configuration.</param>
        /// <param name="peerToPeerConfigCollection">Peer to Peer Configuration collection.</param>
        protected void AddDicomServer(DicomServerTypeEnum dicomServerType, ActorTypeEnum fromActorType, CommonConfig commonConfig, BasePeerToPeerConfigCollection peerToPeerConfigCollection)
        {
            foreach (BasePeerToPeerConfig basePeerToPeerConfig in peerToPeerConfigCollection)
            {
                if ((basePeerToPeerConfig is DicomPeerToPeerConfig) &&
                    (basePeerToPeerConfig.ToActorName.TypeId == _actorName.TypeId) &&
                    (basePeerToPeerConfig.FromActorName.Type == fromActorType))
                {
                    DicomServer dicomServer = ClientServerFactory.CreateDicomServer(dicomServerType, this, basePeerToPeerConfig.FromActorName);
                    if (dicomServer != null)
                    {
                        dicomServer.ApplyConfig(commonConfig, (DicomPeerToPeerConfig)basePeerToPeerConfig);
                        SubscribeEvent(dicomServer);
                        _dicomServers.Add(dicomServer.ActorName.TypeId, dicomServer);

                        // Initialize the connection with the from actor as being active.
                        // - this can always be overruled by the application later.
                        SetActorDefaultConnectionActive(basePeerToPeerConfig.FromActorName);
                    }
                }
            }
        }