/// <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 ); }
public static StyleManager Display(this StyleManager style, DisplayValue value) { style.SetValue(name, value.ValueString); return(style); }
public static DisplayValue Display(this StyleManager style) { throw new NotImplementedException(); }
public static StyleManager Padding(this StyleManager style, CssBox <CssLengthValue> value) { return(style); }
public static CssBox <CssLengthValue> Padding(this StyleManager style) { throw new NotImplementedException(); }
public static StyleManager Visibility(this StyleManager style, VisibilityValue value) { style.SetValue(name, value.ValueString); return(style); }
public static VisibilityValue Visibility(this StyleManager style) { throw new NotImplementedException(); }