/// <summary> /// 展开 CSS 样式属性的缩写形式 /// </summary> /// <param name="property">样式属性设置</param> /// <returns>展开后的形式,若该设置不是缩写形式,则原样返回</returns> protected virtual IEnumerable <CssStyleProperty> ExtractShorthand(CssStyleProperty property) { lock ( SyncRoot ) { if (StyleShorthandRules.Contains(property.Name)) { return(StyleShorthandRules[property.Name].ExtractProperties(property.Value)); } else { return new[] { property } }; } }
/// <summary> /// 检查 CSS 样式属性设置是否合法有效 /// </summary> /// <param name="property">要检查的 CSS 样式属性设置</param> /// <returns>是否合法有效</returns> protected abstract bool ValidateProperty(CssStyleProperty property);
/// <summary> /// 检查 CSS 样式属性设置是否合法有效 /// </summary> /// <param name="property">要检查的 CSS 样式属性设置</param> /// <returns>是否合法有效</returns> protected override bool ValidateProperty(CssStyleProperty property) { return(true); }