public string GenerateCode() { Header header = new Header() { LogoPath = this.LogoPath }; Footer footer = new Footer(); ContactSection contactSection = null; if (this.HasContactSection) { contactSection = new ContactSection(); } GoogleMapsSection googleMapsSection = null; if (this.HasGoogleMapsSection) { googleMapsSection = new GoogleMapsSection(); } MainContent main = new MainContent(this.SectionList.ToList(), contactSection, googleMapsSection); Head head = new Head(); Body body = new Body(header, main, footer); if (this.SectionList.Any(x => x.Type == SectionType.Gallery)) { head.AddAdditionalCss("<link rel=\"stylesheet\" href=\"css/gallery.css\">"); } return(TemplateManager.Current.PageTemplate .Replace("{HEAD}", head.GenerateCode()) .Replace("{BODY}", body.GenerateCode())); }
/// <summary> /// Constructors /// </summary> /// <param name="header"></param> /// <param name="main"></param> /// <param name="footer"></param> public Body(Header header, MainContent main, Footer footer) { this.Header = header; this.Main = main; this.Footer = footer; }