Пример #1
0
 /// <summary>
 /// Asigns the given css style block properties to the given css box.
 /// </summary>
 /// <param name="box">the css box to assign css to</param>
 /// <param name="block">the css block to assign</param>
 private static void AssignCssBlock(CssBox box, CssBlock block)
 {
     foreach (var prop in block.Properties)
     {
         var value = prop.Value;
         if (prop.Value == CssConstants.Inherit && box.ParentBox != null)
         {
             value = CssUtils.GetPropertyValue(box.ParentBox, prop.Key);
         }
         CssUtils.SetPropertyValue(box, prop.Key, value);
     }
 }
Пример #2
0
 /// <summary>
 /// Assigns the given css style block properties to the given css box.
 /// </summary>
 /// <param name="box">the css box to assign css to</param>
 /// <param name="block">the css block to assign</param>
 private static void AssignCssBlock(CssBox box, CssBlock block)
 {
     foreach (var prop in block.Properties)
     {
         string value = prop.Value;
         if (prop.Value == CssConstants.Inherit && box.ParentBox != null)
         {
             value = CssUtils.GetPropertyValue(box.ParentBox, prop.Key);
         }
         if (IsStyleOnElementAllowed(box, prop.Key, value))
         {
             CssUtils.SetPropertyValue(box, prop.Key, value);
         }
     }
 }
Пример #3
0
 public string this[string property]
 {
     get { return(CssUtils.GetPropertyValue(_element, property)); }
     set { CssUtils.SetPropertyValue(_element, property, value); }
 }