Exemple #1
0
    /// <summary>
    /// 获取指定元素的样式管理器
    /// </summary>
    /// <param name="element">要获取样式管理器的元素</param>
    /// <returns>获取的样式管理器</returns>
    internal static StyleManager GetStyleManager( IHtmlElement element )
    {
      var dataContainer = element as IDataContainer;


      //如果 style 属性支持缓存数据容器,则尝试缓存获取。
      if ( dataContainer != null )
      {
        var manager = dataContainer.Data[typeof( StyleManager )] as StyleManager;
        if ( manager != null )
          return manager;

        dataContainer.Data[typeof( StyleManager )] = manager = new StyleManager( element );
        return manager;
      }

      return new StyleManager( element );
    }
Exemple #2
0
 public static StyleManager Display(this StyleManager style, DisplayValue value)
 {
     style.SetValue(name, value.ValueString);
     return(style);
 }
Exemple #3
0
 public static DisplayValue Display(this StyleManager style)
 {
     throw new NotImplementedException();
 }
Exemple #4
0
 public static StyleManager Padding(this StyleManager style, CssBox <CssLengthValue> value)
 {
     return(style);
 }
Exemple #5
0
 public static CssBox <CssLengthValue> Padding(this StyleManager style)
 {
     throw new NotImplementedException();
 }
Exemple #6
0
 public static StyleManager Visibility(this StyleManager style, VisibilityValue value)
 {
     style.SetValue(name, value.ValueString);
     return(style);
 }
Exemple #7
0
 public static VisibilityValue Visibility(this StyleManager style)
 {
     throw new NotImplementedException();
 }