Example #1
0
 public static Template Create(TemplateRegistry templateRegistry, XmlElement xml)
 {
     if (xml.HasAttribute("Master"))
     {
         return(new SubTemplate(templateRegistry, xml));
     }
     return(new MasterTemplate(xml));
 }
Example #2
0
 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);
 }
Example #3
0
 public PageRegistry(TemplateRegistry templates, XmlElement pagesRootNode, string prefixAllPathsWith)
 {
     this.templates          = templates;
     this.prefixAllPathsWith = prefixAllPathsWith;
     Load(pagesRootNode);
 }
Example #4
0
 public PageRegistry(TemplateRegistry templates, string prefixAllPathsWith)
 {
     this.templates          = templates;
     this.prefixAllPathsWith = prefixAllPathsWith;
 }
Example #5
0
 public PageEntry(TemplateRegistry sourceTemplateRegistry, IDataReader reader)
 {
     this.sourceTemplateRegistry = sourceTemplateRegistry;
 }
Example #6
0
 public PageEntry(TemplateRegistry sourceTemplateRegistry)
 {
     this.sourceTemplateRegistry = sourceTemplateRegistry;
 }
Example #7
0
 public PageEntry(TemplateRegistry sourceTemplateRegistry)
 {
     this.sourceTemplateRegistry = sourceTemplateRegistry;
 }
Example #8
0
 public static Template Create(TemplateRegistry templateRegistry, XmlElement xml)
 {
     if (xml.HasAttribute("Master"))
         return new SubTemplate(templateRegistry, xml);
     return new MasterTemplate(xml);
 }
Example #9
0
 public PageRegistry(TemplateRegistry templates, XmlElement pagesRootNode)
 {
     this.templates = templates;
     Load(pagesRootNode);
 }
Example #10
0
 public PageRegistry(TemplateRegistry templates)
 {
     this.templates = templates;
 }
Example #11
0
 public PageRegistry(TemplateRegistry templates, XmlElement pagesRootNode, string prefixAllPathsWith)
 {
     this.templates = templates;
     this.prefixAllPathsWith = prefixAllPathsWith;
     Load(pagesRootNode);
 }
Example #12
0
 public PageRegistry(TemplateRegistry templates, string prefixAllPathsWith)
 {
     this.templates = templates;
     this.prefixAllPathsWith = prefixAllPathsWith;
 }
Example #13
0
 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);
         }
     }
 }
Example #14
0
 public PageRegistry(TemplateRegistry templates, XmlElement pagesRootNode)
 {
     this.templates = templates;
     Load(pagesRootNode);
 }
Example #15
0
 public PageEntry(TemplateRegistry sourceTemplateRegistry, IDataReader reader)
 {
     this.sourceTemplateRegistry = sourceTemplateRegistry;
 }
Example #16
0
 public PageRegistry(TemplateRegistry templates)
 {
     this.templates = templates;
 }
Example #17
0
 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);
 }