public static List <ReportViewTemplate> LoadTemplates(string templateFolder) { List <ReportViewTemplate> viewTemplates = new List <ReportViewTemplate>(); //Templates foreach (var path in Directory.GetFiles(templateFolder, "*.cshtml")) { if (path.EndsWith(".config.cshtml")) { continue; } ReportViewTemplate template = new ReportViewTemplate(); template.Init(path); viewTemplates.Add(template); } return(viewTemplates); }
/// <summary> /// Returns a list of ReportViewTemplate from a given folder /// </summary> public static List <ReportViewTemplate> LoadTemplates(string templateFolder) { List <ReportViewTemplate> viewTemplates = new List <ReportViewTemplate>(); //Templates foreach (var path in Directory.GetFiles(templateFolder, "*.cshtml")) { if (path.EndsWith(".config.cshtml") || path.EndsWith(".partial.cshtml")) { continue; } if (path.EndsWith("ModelContainer.cshtml")) { continue; //backward compatibility before 6.1 } ReportViewTemplate template = new ReportViewTemplate(); if (template.Init(path)) { viewTemplates.Add(template); } } return(viewTemplates); }