ln.templates/ln.templates/html/TemplateDocument.cs

35 lines
932 B
C#

// /**
// * File: TemplateDocument.cs
// * Author: haraldwolff
// *
// * This file and it's content is copyrighted by the Author and / or copyright holder.
// * Any use wihtout proper permission is illegal and may lead to legal actions.
// *
// *
// **/
using System;
using System.IO;
namespace ln.templates.html
{
public class TemplateDocument : DocumentElement
{
public TemplateDocument()
{
}
public void RenderTemplate(Context renderContext)
{
if (DocType is not null)
renderContext.TargetWriter.Write("<!DOCTYPE {0}>", DocType);
foreach (var child in Children)
{
if (child is TemplateElement templateElement)
templateElement.RenderTemplate(renderContext);
else
child.Render(renderContext.TargetWriter);
}
}
}
}