Beispiel #1
0
        static void registerStyles(ICollection <ThemingInstruction> styleArray)
        {
            var document     = HTMLPage.Document;
            var head         = document.GetElementsByTagName("head")[0];
            var styleElement = document.CreateElement <HTMLStyleElement>();

            (string styleString, bool themable) = resolveThemableArray(styleArray);

            styleElement.Type = "text/css";

            styleElement.AppendChild(document.CreateTextNode(styleString));
            themeState.Performance.Count++;
            head.AppendChild(styleElement);

            var record = new StyleRecord()
            {
                StyleElement  = styleElement,
                ThemableStyle = styleArray,
            };

            if (themable)
            {
                themeState.RegisteredThemableStyles.Add(record);
            }
            else
            {
                themeState.RegisteredStyles.Add(record);
            }
        }
Beispiel #2
0
 private static void applyThemableStyles(ICollection <ThemingInstruction> styles, StyleRecord styleRecord = null)
 {
     if (themeState.LoadStyle(resolveThemableArray(styles).styleString, styles))
     {
         registerStyles(styles);
     }
 }