Class TextCSTemplateCompiler
Compiles templates based of text files that use C# language syntax
Inheritance
System.Object
TextCSTemplateCompiler
Implements
System.IDisposable
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.dll
Syntax
public class TextCSTemplateCompiler : TemplateCompiler, IDisposable, IConfigurable, IEnumerable<CompileUnit>, IEnumerable
Examples
#<conf>
<compiler base-class-name="Azos.Web.Templatization.SimpleWebTemplate"
namespace="TestWebApp.Templates"
abstract="true"
summary="Test master page"
/>
#</conf>
#[class]
public string Title { get {return "aaaaa"; } }
protected abstract void renderHeader();
protected abstract void renderBody(bool showDetails);
protected abstract void renderFooter();
#[render]
<html>
<head>
<title>?[Title]</title>
</head>
<body>
<h1>This is Header</h1>
@[renderHeader();]
<h1>This is Body</h1>
@[renderBody(true);]
<p>This is in master page</p>
<h1>This is Footer</h1>
@[renderFooter();]
</body>
</html>
Constructors
TextCSTemplateCompiler()
Declaration
public TextCSTemplateCompiler()
TextCSTemplateCompiler(ITemplateSource<String>[])
Declaration
public TextCSTemplateCompiler(params ITemplateSource<string>[] sources)
Parameters
TextCSTemplateCompiler(IEnumerable<ITemplateSource<String>>)
Declaration
public TextCSTemplateCompiler(IEnumerable<ITemplateSource<string>> sources)
Parameters
| Type |
Name |
Description |
| System.Collections.Generic.IEnumerable<ITemplateSource<System.String>> |
sources |
|
Fields
AREA
Declaration
public const string AREA = "#["
Field Value
| Type |
Description |
| System.String |
|
AREA_ESCAPE
Declaration
public const string AREA_ESCAPE = "##"
Field Value
| Type |
Description |
| System.String |
|
CLASS_AREA
Declaration
public const string CLASS_AREA = "class"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_ABSTRACT_ATTR
Declaration
public const string CONFIG_ABSTRACT_ATTR = "abstract"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_ATTRIBUTE_DECL_ATTR
Declaration
public const string CONFIG_ATTRIBUTE_DECL_ATTR = "decl"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_ATTRIBUTE_SECTION
Declaration
public const string CONFIG_ATTRIBUTE_SECTION = "attribute"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_BASE_CLASS_NAME_ATTR
Declaration
public const string CONFIG_BASE_CLASS_NAME_ATTR = "base-class-name"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_BASE_RENDER_ATTR
Declaration
public const string CONFIG_BASE_RENDER_ATTR = "base-render"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_CLASS_CONSTRAINT_ATTR
Declaration
public const string CONFIG_CLASS_CONSTRAINT_ATTR = "class-constraint"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_CLASS_DECLARATION_ATTR
Declaration
public const string CONFIG_CLASS_DECLARATION_ATTR = "class-declaration"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_CLASS_NAME_ATTR
Declaration
public const string CONFIG_CLASS_NAME_ATTR = "class-name"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_COMPILER_SECTION
Declaration
public const string CONFIG_COMPILER_SECTION = "compiler"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_END
Declaration
public const string CONFIG_END = "#</conf>"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_NAMESPACE_ATTR
Declaration
public const string CONFIG_NAMESPACE_ATTR = "namespace"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_REF_ASSEMBLY_NAME_ATTR
Declaration
public const string CONFIG_REF_ASSEMBLY_NAME_ATTR = "name"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_REF_ASSEMBLY_SECTION
Declaration
public const string CONFIG_REF_ASSEMBLY_SECTION = "ref-asm"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_START
Declaration
public const string CONFIG_START = "#<conf>"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_SUMMARY_ATTR
Declaration
public const string CONFIG_SUMMARY_ATTR = "summary"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_USING_NS_ATTR
Declaration
public const string CONFIG_USING_NS_ATTR = "ns"
Field Value
| Type |
Description |
| System.String |
|
CONFIG_USING_SECTION
Declaration
public const string CONFIG_USING_SECTION = "using"
Field Value
| Type |
Description |
| System.String |
|
DEFAULT_BASE_TEMPLATE_CLASS_NAME
Declaration
public const string DEFAULT_BASE_TEMPLATE_CLASS_NAME = "Azos.Templatization.Template<object, Azos.Templatization.IRenderingTarget, object>"
Field Value
| Type |
Description |
| System.String |
|
EXPRESSION
Declaration
public const string EXPRESSION = "?["
Field Value
| Type |
Description |
| System.String |
|
EXPRESSION_ESCAPE
Declaration
public const string EXPRESSION_ESCAPE = "??"
Field Value
| Type |
Description |
| System.String |
|
LACONFIG_END
Declaration
public const string LACONFIG_END = "#</laconf>"
Field Value
| Type |
Description |
| System.String |
|
LACONFIG_START
Declaration
public const string LACONFIG_START = "#<laconf>"
Field Value
| Type |
Description |
| System.String |
|
OVERRIDE
Declaration
public const string OVERRIDE = "override"
Field Value
| Type |
Description |
| System.String |
|
RENDER_AREA
Declaration
public const string RENDER_AREA = "render"
Field Value
| Type |
Description |
| System.String |
|
SPAN_CLOSE
Declaration
public const char SPAN_CLOSE = ']'
Field Value
| Type |
Description |
| System.Char |
|
SPAN_OPEN
Declaration
public const char SPAN_OPEN = '['
Field Value
| Type |
Description |
| System.Char |
|
STATEMENT
Declaration
public const string STATEMENT = "@["
Field Value
| Type |
Description |
| System.String |
|
STATEMENT_ESCAPE
Declaration
public const string STATEMENT_ESCAPE = "@@"
Field Value
| Type |
Description |
| System.String |
|
VERBATIM
Declaration
public const string VERBATIM = ":"
Field Value
| Type |
Description |
| System.String |
|
VIRTUAL
Declaration
public const string VIRTUAL = "virtual"
Field Value
| Type |
Description |
| System.String |
|
Properties
LanguageName
Declaration
public override string LanguageName { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
LanguageSourceFileExtension
Declaration
public override string LanguageSourceFileExtension { get; }
Property Value
| Type |
Description |
| System.String |
|
Overrides
Methods
DoCompileCode()
Declaration
protected override void DoCompileCode()
Overrides
DoCompileTemplateSource(CompileUnit)
Declaration
protected override void DoCompileTemplateSource(CompileUnit unit)
Parameters
Overrides
GetCompileUnitSourceContent(CompileUnit, out String)
Declaration
protected virtual string GetCompileUnitSourceContent(CompileUnit unit, out string className)
Parameters
| Type |
Name |
Description |
| CompileUnit |
unit |
|
| System.String |
className |
|
Returns
| Type |
Description |
| System.String |
|
Implements
System.IDisposable
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods