Exemplo n.º 1
0
        /// <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 }
                };
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 检查 CSS 样式属性设置是否合法有效
 /// </summary>
 /// <param name="property">要检查的 CSS 样式属性设置</param>
 /// <returns>是否合法有效</returns>
 protected abstract bool ValidateProperty(CssStyleProperty property);
Exemplo n.º 3
0
 /// <summary>
 /// 检查 CSS 样式属性设置是否合法有效
 /// </summary>
 /// <param name="property">要检查的 CSS 样式属性设置</param>
 /// <returns>是否合法有效</returns>
 protected override bool ValidateProperty(CssStyleProperty property)
 {
     return(true);
 }