Beispiel #1
0
        public static IEnumerable<ThemeFile> Parse(Theme theme, out string themeRuleBody, string baseUri=null)
        {
            theme = theme.LastVersion();
            IEnumerable<ThemeFile> themeFiles = ServiceFactory.ThemeManager.AllStyles(theme);
            ThemeRuleFile cssHackFile = ServiceFactory.ThemeManager.GetCssHack(theme);
            if (cssHackFile == null || !cssHackFile.Exists())
            {
                themeRuleBody = "";
                return themeFiles;
            }

            var themeRuleFiles = Parser.Parse(cssHackFile.Read(), (fileVirtualPath) => UrlUtility.ToHttpAbsolute(baseUri, new ThemeFile(theme, fileVirtualPath).LastVersion().VirtualPath), out themeRuleBody);

            return themeFiles.Where(it => !themeRuleFiles.Any(cf => cf.EqualsOrNullEmpty(it.FileName, StringComparison.CurrentCultureIgnoreCase)));
        }
Beispiel #2
0
 public IEnumerable<ThemeImageFile> AllImagesEnumerable(Theme theme)
 {
     List<ThemeImageFile> list = new List<ThemeImageFile>();
     theme = theme.LastVersion();
     if (theme.Exists())
     {
         ThemeImageFile dummy = new ThemeImageFile(theme, "dummy");
         var baseDir = dummy.BasePhysicalPath;
         if (Directory.Exists(baseDir))
         {
             foreach (var file in Directory.EnumerateFiles(baseDir))
             {
                 list.Add(new ThemeImageFile(theme, Path.GetFileName(file)));
             }
         }
     }
     return list;
 }