Пример #1
0
        protected override Boolean IsValid(CSSValue value)
        {
            var      list = value as CSSValueList ?? new CSSValueList(value);
            CSSValue width = null, color = null, style = null;

            if (list.Length > 3)
            {
                return(false);
            }

            for (int i = 0; i < list.Length; i++)
            {
                if (!_width.CanStore(list[i], ref width) && !_style.CanStore(list[i], ref style) && !_color.CanStore(list[i], ref color))
                {
                    return(false);
                }
            }

            return(_width.TrySetValue(width) && _style.TrySetValue(style) && _color.TrySetValue(color));
        }
Пример #2
0
        protected override Boolean IsValid(CSSValue value)
        {
            var      list = value as CSSValueList ?? new CSSValueList(value);
            CSSValue width = null, color = null, style = null;

            if (list.Length > 3)
            {
                return(false);
            }

            for (int i = 0; i < list.Length; i++)
            {
                if (!_topWidth.CanStore(list[i], ref width) && !_topStyle.CanStore(list[i], ref style) && !_topColor.CanStore(list[i], ref color))
                {
                    return(false);
                }
            }

            return(_topWidth.TrySetValue(width) && _topColor.TrySetValue(color) && _topStyle.TrySetValue(style) &&
                   _leftWidth.TrySetValue(width) && _leftColor.TrySetValue(color) && _leftStyle.TrySetValue(style) &&
                   _rightWidth.TrySetValue(width) && _rightColor.TrySetValue(color) && _rightStyle.TrySetValue(style) &&
                   _bottomWidth.TrySetValue(width) && _bottomColor.TrySetValue(color) && _bottomStyle.TrySetValue(style));
        }