Example #1
0
        private WebPage ParseWebPage(XmlElement element)
        {
            var webPage = WebPage.Create(
                element.GetAttribute("Id"),
                element.GetAttribute("Source")
                );

            webPage.Selector = element.GetAttribute("Selector");
            webPage.Path     = element.GetAttribute("Path");

            foreach (var childElement in element.ChildNodes.OfType <XmlElement>())
            {
                switch (childElement.Name)
                {
                case "Name":
                    webPage.Name = element.GetAttribute("Value");;
                    break;

                case "Url":
                    webPage.Url = element.GetAttribute("Path");
                    break;

                case "Template":
                    webPage.TemplateId      = element.GetAttribute("Module");
                    webPage.TemplateContent = element.GetAttribute("Content");
                    break;
                }
            }

            return(webPage);
        }