void AddServicesToExtension(Extension e, XmlElement el) { foreach (object o in el.ChildNodes) { if (!(o is XmlElement)) { continue; } XmlElement curEl = (XmlElement)o; if (curEl.Name.Equals("Module")) { IModule module = ModuleManager.Instance.ModuleFactory.CreateModule(this, curEl); AutoInitializeAttributes(module, curEl); e.ModulesCollection.Add(module); if (curEl.ChildNodes.Count > 0) { Extension newExtension = new Extension(e.Path + '/' + module.ID); AddServicesToExtension(newExtension, curEl); extensions.Add(newExtension); } } } }
void AddExtensions(XmlElement el) { if (el.Attributes["path"] == null) { throw new PluginLoadException("One extension node has no path attribute defined."); } Extension e = new Extension(el.Attributes["path"].InnerText); AddServicesToExtension(e, el); extensions.Add(e); }