protected Type GetTemplateCodeTypeByFile(String Name)
{
if (TemplateProvider == null) throw(new Exception("No specified TemplateProvider"));
lock (CachedTemplatesByFile)
{
if (!CachedTemplatesByFile.ContainsKey(Name))
{
using (var TemplateStream = TemplateProvider.GetTemplate(Name))
{
return CachedTemplatesByFile[Name] = GetTemplateCodeTypeByString(TemplateStream.ReadAllContentsAsString(Encoding));
}
}
return CachedTemplatesByFile[Name];
}
}