public static Template Create(TemplateRegistry templateRegistry, XmlElement xml) { if (xml.HasAttribute("Master")) { return(new SubTemplate(templateRegistry, xml)); } return(new MasterTemplate(xml)); }
public SubTemplate(TemplateRegistry templateRegistry, XmlElement xml) { this.templateRegistry = templateRegistry; name = xml.GetAttribute("Name"); masterTemplateName = xml.GetAttribute("Master"); foreach (XmlElement xmlreplace in xml.SelectNodes("Replace[@Section]")) { TemplateSectionReplacement replacement = new TemplateSectionReplacement(xmlreplace); if (replacedSections.ContainsKey(replacement.Name)) { throw new Exception("Error building subpage template. There is more than one replacement defined for section \"" + replacement.Name + "\""); } replacedSections.Add(replacement.Name, replacement); } ReadPageAdminSettings(xml); }
public PageRegistry(TemplateRegistry templates, XmlElement pagesRootNode, string prefixAllPathsWith) { this.templates = templates; this.prefixAllPathsWith = prefixAllPathsWith; Load(pagesRootNode); }
public PageRegistry(TemplateRegistry templates, string prefixAllPathsWith) { this.templates = templates; this.prefixAllPathsWith = prefixAllPathsWith; }
public PageEntry(TemplateRegistry sourceTemplateRegistry, IDataReader reader) { this.sourceTemplateRegistry = sourceTemplateRegistry; }
public PageEntry(TemplateRegistry sourceTemplateRegistry) { this.sourceTemplateRegistry = sourceTemplateRegistry; }
public static Template Create(TemplateRegistry templateRegistry, XmlElement xml) { if (xml.HasAttribute("Master")) return new SubTemplate(templateRegistry, xml); return new MasterTemplate(xml); }
public PageRegistry(TemplateRegistry templates, XmlElement pagesRootNode) { this.templates = templates; Load(pagesRootNode); }
public PageRegistry(TemplateRegistry templates) { this.templates = templates; }
void LoadDefinitionFiles() { templates = new TemplateRegistry(); pages = new PageRegistry(templates, "admin"); string dirpath = WebUtility.MapPath("resources/admin"); if(!Directory.Exists(dirpath)) Directory.CreateDirectory(dirpath); foreach (string dir in Directory.GetDirectories(dirpath)) { string path = dir + "\\definitions.xml"; if (File.Exists(path)) { XmlSourceFileDependent file = new XmlSourceFileDependent(path); definitionsFiles.Add(file); XmlElement xml = file.Data.SelectSingleNode("/Definitions") as XmlElement; if (xml == null) continue; xml = file.Data.SelectSingleNode("/Definitions/Templates") as XmlElement; if (xml != null) templates.Load(xml); xml = file.Data.SelectSingleNode("/Definitions/Pages") as XmlElement; if (xml != null) pages.Load(xml); } } }
public SubTemplate(TemplateRegistry templateRegistry, XmlElement xml) { this.templateRegistry = templateRegistry; name = xml.GetAttribute("Name"); masterTemplateName = xml.GetAttribute("Master"); foreach (XmlElement xmlreplace in xml.SelectNodes("Replace[@Section]")) { TemplateSectionReplacement replacement = new TemplateSectionReplacement(xmlreplace); if (replacedSections.ContainsKey(replacement.Name)) throw new Exception("Error building subpage template. There is more than one replacement defined for section \"" + replacement.Name + "\""); replacedSections.Add(replacement.Name, replacement); } ReadPageAdminSettings(xml); }