private void FillTemplateContent(TemplateContent templateContent, string dir)
        {
            // subjects should not be html, but we will first try loading html file 
            if (m_fileSystem.ExistFile(Path.Combine(dir, FILE_SUBJECT + EXT_HTML)))
            {
                templateContent.Subject = m_fileSystem.GetContents(Path.Combine(dir, FILE_SUBJECT + EXT_HTML));
            }
            else
            {
                templateContent.Subject = m_fileSystem.GetContents(Path.Combine(dir, FILE_SUBJECT + EXT_TEXT));
            }

            if (m_fileSystem.ExistFile(Path.Combine(dir, FILE_SUMMARYSUBJECT + EXT_HTML)))
            {
                templateContent.SummarySubject = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYSUBJECT + EXT_HTML));
            }
            else
            {
                templateContent.SummarySubject = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYSUBJECT + EXT_TEXT));
            }

            templateContent.Body = GetContentsExpandIncludes(Path.Combine(dir, FILE_BODY + EXT_HTML));
            templateContent.SummaryBody = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYBODY + EXT_HTML));
            templateContent.SummaryHeader = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYHEADER + EXT_HTML));
            templateContent.SummaryFooter = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYFOOTER + EXT_HTML));

            templateContent.TextBody = GetContentsExpandIncludes(Path.Combine(dir, FILE_BODY + EXT_TEXT));
            templateContent.SummaryTextBody = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYBODY + EXT_TEXT));
            templateContent.SummaryTextHeader = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYHEADER + EXT_TEXT));
            templateContent.SummaryTextFooter = GetContentsExpandIncludes(Path.Combine(dir, FILE_SUMMARYFOOTER + EXT_TEXT));
        }
Ejemplo n.º 2
0
 public Template()
 {
     Content = new TemplateContent();
     Language = CultureInfo.CurrentCulture;
 }