private void WantLoaded() { if (m_xml == null) { XmlDocument doc = new XmlDocument(); doc.Load(m_file); m_xml = doc.DocumentElement; m_model = AddonType.StaticSpace.FindHolder(m_xml.GetAttribute("type")); m_instanceModel = m_model.CreateInstance(); m_instanceModel.LoadFromXml(m_xml); } }
public void AddAssembly(Assembly assembly) { if (AddonType.RegisterAttributeType == null) { return; } foreach (Type tp in assembly.GetTypes()) { foreach (RegisterAttribute attr in tp.GetCustomAttributes(AddonType.RegisterAttributeType, false)) { var hld = new StaticAddonHolder(this, attr, tp); if (hld.Attrib.Name == null) { throw new RegistryError("DAE-00312 Type " + tp.FullName + " has empty Name in attribute"); } m_holders[hld.Attrib.Name] = hld; } } }