Exemplo n.º 1
0
        private static string GetFontPath(XmlNode node)
        {
            string ret = string.Empty;

            foreach (XmlNode subNode in node.ChildNodes)
            {
                if (ProxyDeserializer.SkipNode(subNode))
                {
                    continue;
                }
                if (subNode.Name == "text")
                {
                    if (subNode.Attributes["font"] != null)
                    {
                        ret = subNode.Attributes["font"].Value;
                        break;
                    }
                }
            }
            return(ret);
        }
Exemplo n.º 2
0
        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);
            }
        }