Exemplo n.º 1
0
 internal DestinationSettings(ServiceSettings serviceSettings, string id, AdapterSettings adapter, string source)
 {
     _serviceSettings = serviceSettings;
     _properties      = new Hashtable();
     _channels        = new ChannelSettingsCollection();
     _id      = id;
     _adapter = adapter;
     _properties["source"] = source;
 }
Exemplo n.º 2
0
        internal DestinationSettings(ServiceSettings serviceSettings, XmlNode destinationNode)
        {
            _serviceSettings = serviceSettings;
            _properties      = new Hashtable();
            _channels        = new ChannelSettingsCollection();

            _id = destinationNode.Attributes["id"].Value;

            XmlNode adapterNode = destinationNode.SelectSingleNode("adapter");

            if (adapterNode != null)
            {
                string          adapterRef      = adapterNode.Attributes["ref"].Value;
                AdapterSettings adapterSettings = serviceSettings.AdapterSettings[adapterRef] as AdapterSettings;
                _adapter = adapterSettings;
            }

            _propertiesNode = destinationNode.SelectSingleNode("properties");
            if (_propertiesNode != null)
            {
                XmlNode sourceNode = _propertiesNode.SelectSingleNode("source");
                if (sourceNode != null)
                {
                    _properties["source"] = sourceNode.InnerXml;
                }
                XmlNode factoryNode = _propertiesNode.SelectSingleNode("factory");
                if (factoryNode != null)
                {
                    _properties["factory"] = factoryNode.InnerXml;
                }
                XmlNode attributeIdNode = _propertiesNode.SelectSingleNode("attribute-id");
                if (attributeIdNode != null)
                {
                    //If you specify an attribute-id element in the destination, you can control which attribute the component is stored in
                    //This lets more than one destination share the same instance.
                    _properties["attribute-id"] = attributeIdNode.InnerXml;
                }
                else
                {
                    //Stored using the destination name as the attribute
                    _properties["attribute-id"] = _id;
                }

                XmlNode scopeNode = _propertiesNode.SelectSingleNode("scope");
                if (scopeNode != null)
                {
                    _properties["scope"] = scopeNode.InnerXml;
                }

                XmlNode networkNode = _propertiesNode.SelectSingleNode("network");
                if (networkNode != null)
                {
                    NetworkSettings networkSettings = new NetworkSettings(networkNode);
                    _network = networkSettings;
                }
                XmlNode metadataNode = _propertiesNode.SelectSingleNode("metadata");
                if (metadataNode != null)
                {
                    MetadataSettings metadataSettings = new MetadataSettings(metadataNode);
                    _metadata = metadataSettings;
                }
                XmlNode serverNode = _propertiesNode.SelectSingleNode("server");
                if (serverNode != null)
                {
                    ServerSettings serverSettings = new ServerSettings(serverNode);
                    _server = serverSettings;
                }
                XmlNode msmqNode = _propertiesNode.SelectSingleNode("msmq");
                if (msmqNode != null)
                {
                    MsmqSettings msmqSettings = new MsmqSettings(msmqNode);
                    _msmqSettings = msmqSettings;
                }
            }
            XmlNode channelsNode = destinationNode.SelectSingleNode("channels");

            if (channelsNode != null)
            {
                XmlNodeList channelNodeList = channelsNode.SelectNodes("channel");
                foreach (XmlNode channelNode in channelNodeList)
                {
                    string channelRef = channelNode.Attributes["ref"].Value;
                    if (channelRef != null)
                    {
                        ChannelSettings channelSettings = _serviceSettings.ServiceConfigSettings.ChannelsSettings[channelRef] as ChannelSettings;
                        _channels.Add(channelSettings);
                    }
                    else
                    {
                        ChannelSettings channelSettings = new ChannelSettings(channelNode);
                        _channels.Add(channelSettings);
                    }
                }
            }
        }
Exemplo n.º 3
0
 internal ServiceConfigSettings()
 {
     _channelSettingsCollection = new ChannelSettingsCollection();
     _factorySettingsCollection = new FactorySettingsCollection();
     _serviceSettingsCollection = new ServiceSettingsCollection();
 }