Ejemplo n.º 1
0
        public virtual ThemeRuleFile GetRules(Site site, string themeName)
        {
            Theme theme         = new Theme(site, themeName);
            var   themeRuleFile = new ThemeRuleFile(theme);

            themeRuleFile.Read();

            return(themeRuleFile);
        }
Ejemplo n.º 2
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))));
        }