internal void LoadTemplates() { XmlNodeList blockList = Document.GetElementsByTagName("blocks"); BlockManager = new BlockManager(RootPath); BlockManager.LoadBlocks(blockList[0]); XmlNodeList templateList = Document.GetElementsByTagName("template"); foreach (XmlNode template in templateList) { TemplateDefinition templateDef = TemplateDefinition.LoadCardDefinition(template); templateDef.rootPath = RootPath; TemplateSelector.AddTemplate(templateDef); } }
internal void Load(string path) { if (Document != null) { Document.RemoveAll(); Document = null; TemplateSelector.ClearTemplates(); } Document = new XmlDocument(); Document.Load(path); XmlNodeList blockList = Document.GetElementsByTagName("blocks"); BlockManager = new BlockManager(RootPath); foreach (XmlNode block in blockList[0]) { if (block.Name != "block") { continue; } BlockDefinition blockDef = ProxyDeserializer.DeserializeBlock(BlockManager, block); BlockManager.AddBlock(blockDef); } XmlNodeList templateList = Document.GetElementsByTagName("template"); foreach (XmlNode template in templateList) { if (template.Name != "template") { continue; } TemplateDefinition templateDef = ProxyDeserializer.DeserializeTemplate(template); templateDef.rootPath = RootPath; TemplateSelector.AddTemplate(templateDef); } }