Ejemplo n.º 1
0
 /// <summary>
 /// Asigns the given css style blocks to the given css box checking if matching.
 /// </summary>
 /// <param name="box">the css box to assign css to</param>
 /// <param name="cssData">the css data to use to get the matching css blocks</param>
 /// <param name="className">the class selector to search for css blocks</param>
 private static void AssignCssBlocks(CssBox box, CssData cssData, string className)
 {
     var blocks = cssData.GetCssBlock(className);
     foreach (var block in blocks)
     {
         if (IsBlockAssignableToBox(box, block))
         {
             AssignCssBlock(box, block);
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Assigns the given css style blocks to the given css box checking if matching.
        /// </summary>
        /// <param name="box">the css box to assign css to</param>
        /// <param name="cssData">the css data to use to get the matching css blocks</param>
        /// <param name="className">the class selector to search for css blocks</param>
        private static void AssignCssBlocks(CssBox box, CssData cssData, string className)
        {
            var blocks = cssData.GetCssBlock(className);

            foreach (var block in blocks)
            {
                if (IsBlockAssignableToBox(box, block))
                {
                    AssignCssBlock(box, block);
                }
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Set the selected text style (selection text color and background color).
        /// </summary>
        /// <param name="htmlContainer"> </param>
        /// <param name="cssData">the style data</param>
        private void SetTextSelectionStyle(HtmlContainerInt htmlContainer, CssData cssData)
        {
            htmlContainer.SelectionForeColor = RColor.Empty;
            htmlContainer.SelectionBackColor = RColor.Empty;

            if (cssData.ContainsCssBlock("::selection"))
            {
                var blocks = cssData.GetCssBlock("::selection");
                foreach (var block in blocks)
                {
                    if (block.Properties.ContainsKey("color"))
                    {
                        htmlContainer.SelectionForeColor = _cssParser.ParseColor(block.Properties["color"]);
                    }
                    if (block.Properties.ContainsKey("background-color"))
                    {
                        htmlContainer.SelectionBackColor = _cssParser.ParseColor(block.Properties["background-color"]);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Set the selected text style (selection text color and background color).
        /// </summary>
        /// <param name="htmlContainer"> </param>
        /// <param name="cssData">the style data</param>
        private static void SetTextSelectionStyle(HtmlContainer htmlContainer, CssData cssData)
        {
            htmlContainer.SelectionForeColor = Color.Empty;
            htmlContainer.SelectionBackColor = Color.Empty;

            if (cssData.ContainsCssBlock("::selection"))
            {
                IEnumerable <CssBlock> blocks = cssData.GetCssBlock("::selection");
                foreach (CssBlock block in blocks)
                {
                    if (block.Properties.ContainsKey("color"))
                    {
                        htmlContainer.SelectionForeColor = CssValueParser.GetActualColor(block.Properties["color"]);
                    }
                    if (block.Properties.ContainsKey("background-color"))
                    {
                        htmlContainer.SelectionBackColor =
                            CssValueParser.GetActualColor(block.Properties["background-color"]);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Set the selected text style (selection text color and background color).
        /// </summary>
        /// <param name="htmlContainer"> </param>
        /// <param name="cssData">the style data</param>
        private void SetTextSelectionStyle(HtmlContainerInt htmlContainer, CssData cssData)
        {
            htmlContainer.SelectionForeColor = RColor.Empty;
            htmlContainer.SelectionBackColor = RColor.Empty;

            if (cssData.ContainsCssBlock("::selection"))
            {
                var blocks = cssData.GetCssBlock("::selection");
                foreach (var block in blocks)
                {
                    if (block.Properties.ContainsKey("color"))
                        htmlContainer.SelectionForeColor = _cssParser.ParseColor(block.Properties["color"]);
                    if (block.Properties.ContainsKey("background-color"))
                        htmlContainer.SelectionBackColor = _cssParser.ParseColor(block.Properties["background-color"]);
                }
            }
        }