Exemplo n.º 1
0
        public static TemplateParser GetParser( String absPath, String templateContent )
        {
            if (strUtil.IsNullOrEmpty( templateContent )) return new TemplateParser( new CharSource( null ) );

            String _cacheKey = absPath;

            if (parserCache.ContainsKey( _cacheKey )==false) {

                lock (objLock) {

                    if (parserCache.ContainsKey( _cacheKey ) == false) {

                        TemplateParser tp = new TemplateParser( new CharSource( templateContent ) );
                        parserCache.Add( _cacheKey, tp );

                    }
                }

            }

            return (TemplateParser)parserCache[_cacheKey];
        }