public string LoadTemplate(string templateName, CultureInfo culture, FogBugzCase cases) { if (culture == null) { culture = CultureInfo.InvariantCulture; } string text = File.ReadAllText(Path.Combine("Views", culture.ToString(), templateName + ".cshtml")); return(Razor.Parse(text, cases)); }
public string GetEmailBody(string templateName, FogBugzCase selectedCase) { string emailBody = null; if (templateName == null) { throw new ArgumentNullException("templateName"); } var parser = new FileSystemTemplateLoader(); emailBody = parser.LoadTemplate(templateName, null, selectedCase); return(emailBody); }
public string Parse(string templateName, CultureInfo culture, FogBugzCase parameters) { return(RazorEngine.Razor.Parse(templateLoader.LoadTemplate(templateName, culture), parameters)); }