C# Class SharpTAL.TemplateCache.AbstractTemplateCache

Inheritance: ITemplateCache
Afficher le fichier Open project: lck/SharpTAL

Méthodes publiques

Méthode Description
CompileTemplate ( string templateBody, Type>.Dictionary globalsTypes, List referencedAssemblies ) : TemplateInfo

Compile template to ensure that the compiled assembly is already in cache when RenderTemplate is called for the first time. For precompiling, the actual values of globals are not required, just the names and types of the global variables.

Méthodes protégées

Méthode Description
ComputeTemplateKey ( TemplateInfo ti ) : string

Returns a unique key that represent the template in the template cache. The template key is computed from the following parts: Template body hash, Global types hash, Imported templates hash, Referenced assemblies hash

GenerateTemplateProgram ( string templateBody, Type>.Dictionary globalsTypes, List referencedAssemblies ) : TemplateInfo

Generate template program from template body and generate the TemplateKey

GetTemplateGeneratorVersion ( Assembly assembly, TemplateInfo ti ) : string

Try to find the template source generator version

GetTemplateRenderMethod ( Assembly assembly, TemplateInfo ti ) : MethodInfo

Try to find the render method in assembly

Method Details

CompileTemplate() public abstract méthode

Compile template to ensure that the compiled assembly is already in cache when RenderTemplate is called for the first time. For precompiling, the actual values of globals are not required, just the names and types of the global variables.
public abstract CompileTemplate ( string templateBody, Type>.Dictionary globalsTypes, List referencedAssemblies ) : TemplateInfo
templateBody string The template body
globalsTypes Type>.Dictionary Dictionary of types of global variables
referencedAssemblies List List of referenced assemblies
Résultat TemplateInfo

ComputeTemplateKey() protected static méthode

Returns a unique key that represent the template in the template cache. The template key is computed from the following parts: Template body hash, Global types hash, Imported templates hash, Referenced assemblies hash
protected static ComputeTemplateKey ( TemplateInfo ti ) : string
ti TemplateInfo Template info
Résultat string

GenerateTemplateProgram() protected static méthode

Generate template program from template body and generate the TemplateKey
protected static GenerateTemplateProgram ( string templateBody, Type>.Dictionary globalsTypes, List referencedAssemblies ) : TemplateInfo
templateBody string
globalsTypes Type>.Dictionary
referencedAssemblies List
Résultat TemplateInfo

GetTemplateGeneratorVersion() protected static méthode

Try to find the template source generator version
protected static GetTemplateGeneratorVersion ( Assembly assembly, TemplateInfo ti ) : string
assembly System.Reflection.Assembly
ti TemplateInfo
Résultat string

GetTemplateRenderMethod() protected static méthode

Try to find the render method in assembly
protected static GetTemplateRenderMethod ( Assembly assembly, TemplateInfo ti ) : MethodInfo
assembly System.Reflection.Assembly
ti TemplateInfo
Résultat System.Reflection.MethodInfo