Exemplo n.º 1
0
        public string GetHtmByFilepath(string filename)
        {
            if (string.IsNullOrEmpty(filename))
            {
                return(string.Empty);
            }

            L2Html html = _htmCache.FirstOrDefault(x => x.Filepath.EqualsIgnoreCase(filename));

            return(html != null ? html.Content : string.Empty);
        }
Exemplo n.º 2
0
        public string GetHtmByFilepath(string filename)
        {
            if (string.IsNullOrEmpty(filename))
            {
                return(string.Empty);
            }

            L2Html html = _htmCache.FirstOrDefault(x => x.Filepath.EqualsIgnoreCase(filename));

            if (Config.Config.Instance.ServerConfig.LazyHtmlCache && html == null)
            {
                //Fallback for non loaded files
                string predictedFile = _htmFiles.FirstOrDefault(f => f == filename);
                if (predictedFile != null)
                {
                    CacheFile(predictedFile);
                    //Try Again
                    html = _htmCache.FirstOrDefault(x => x.Filename.EqualsIgnoreCase(Path.GetFileNameWithoutExtension(predictedFile)));
                }
            }
            return(html != null ? html.Content : string.Empty);
        }