public TemplateConfig AddTemplateconfig(TemplateConfigAddCommand command) { if (TemplateConfigs == null) { TemplateConfigs = new List <TemplateConfig>(); } TemplateConfig templateConfig = new TemplateConfig(); templateConfig.Init(command); TemplateConfigs.Add(templateConfig); AddEvent(ToAddOrChangeCacheEvent()); return(templateConfig); }
void LoadTemplates(String templateDir, String[] lines) { var templatesConfigLines = lines.Where(l => !l.Contains("=")); foreach (var l in templatesConfigLines) { if (!String.IsNullOrWhiteSpace(l) && !l.StartsWith("#")) { var tc = new TemplateConfig(l); //load template tc.TemplateString = File.ReadAllText(Path.Combine(templateDir, tc.Name)); TemplateConfigs.Add(tc); } } }