internal CSSBorderImageWidthProperty()
     : base(PropertyNames.BorderImageWidth)
 {
     _inherited = false;
     _top = _default;
     _right = _default;
     _bottom = _default;
     _left = _default;
 }
 internal CSSBorderImageWidthProperty()
     : base(PropertyNames.BorderImageWidth)
 {
     _inherited = false;
     _top       = _default;
     _right     = _default;
     _bottom    = _default;
     _left      = _default;
 }
        /// <summary>
        /// Determines if the given value represents a valid state of this property.
        /// </summary>
        /// <param name="value">The state that should be used.</param>
        /// <returns>True if the state is valid, otherwise false.</returns>
        protected override Boolean IsValid(CSSValue value)
        {
            var mode = ToMode(value);

            if (mode != null)
                _top = _right = _left = _bottom = mode;
            else if (value is CSSValueList)
                return Evaluate((CSSValueList)value);
            else if (value != CSSValue.Inherit)
                return false;

            return true;
        }
        Boolean Evaluate(CSSValueList values)
        {
            if (values.Length > 4)
            {
                return(false);
            }

            var top    = ToMode(values[0]);
            var right  = ToMode(values[1]);
            var bottom = top;
            var left   = right;

            if (top == null || right == null)
            {
                return(false);
            }

            if (values.Length > 2)
            {
                bottom = ToMode(values[2]);

                if (bottom == null)
                {
                    return(false);
                }

                if (values.Length > 3)
                {
                    left = ToMode(values[3]);

                    if (left == null)
                    {
                        return(false);
                    }
                }
            }

            _left   = left;
            _right  = right;
            _bottom = bottom;
            _top    = top;
            return(true);
        }
        protected override Boolean IsValid(CSSValue value)
        {
            var mode = ToMode(value);

            if (mode != null)
            {
                _top = _right = _left = _bottom = mode;
            }
            else if (value is CSSValueList)
            {
                return(Evaluate((CSSValueList)value));
            }
            else if (value != CSSValue.Inherit)
            {
                return(false);
            }

            return(true);
        }
        Boolean Evaluate(CSSValueList values)
        {
            if (values.Length > 4)
                return false;

            var top = ToMode(values[0]);
            var right = ToMode(values[1]);
            var bottom = top;
            var left = right;

            if (top == null || right == null)
                return false;

            if (values.Length > 2)
            {
                bottom = ToMode(values[2]);

                if (bottom == null)
                    return false;

                if (values.Length > 3)
                {
                    left = ToMode(values[3]);

                    if (left == null)
                        return false;
                }
            }

            _left = left;
            _right = right;
            _bottom = bottom;
            _top = top;
            return true;
        }