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); }
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); }