Esempio n. 1
0
        private void Load(XDocument xDoc)
        {
            foreach (var adapterElement in xDoc.Elements("Adapter"))
            {
                IAdapter adapter = null;

                string adapterType = GetAttribute(adapterElement, "Type");
                string adapterName = GetAttribute(adapterElement, "Name");

                _currentAdapterName = adapterName;

                Dictionary <string, object> adapterObjects = new Dictionary <string, object>();
                _adapterObjects.Add(adapterName, adapterObjects);

                adapter = GetAdapter(adapterElement);

                _adapters.Add(adapter.Name, adapter);

                foreach (var activatorElement in adapterElement.Elements("Activator"))
                {
                    IActivator activator = GetActivator(activatorElement, adapter.GetChannel());
                    adapter.AddActivator(activator);
                }

                if (adapterElement.Element("EventConnecter") != null)
                {
                    foreach (var eventConnecterElement in adapterElement.Elements("EventConnecter"))
                    {
                        GetEventConnecter(eventConnecterElement);
                    }
                }
            }
        }