Argentini.Halide.H3EmailTemplate.H3EmailTemplate C# (CSharp) Méthode

H3EmailTemplate() public méthode

Constructor accepts the path to a template file on disk.
public H3EmailTemplate ( string templatePath ) : System
templatePath string
Résultat System
        public H3EmailTemplate(string templatePath)
        {
            if (templatePath.Length > 2)
            {
                if (templatePath.Substring(1, 1) != ":" && !templatePath.StartsWith(@"\\"))
                {
                    templatePath = HttpContext.Current.Server.MapPath(templatePath);
                }
            }

            if (!File.Exists(templatePath))
            {
                throw new FileNotFoundException("File not found: " + templatePath);
            }

            _templatePath = templatePath;
            _templateContents = File.ReadAllText(templatePath);
            _findReplaceItems = new Dictionary<string, string>();
        }