예제 #1
0
 internal CSSListStyleProperty()
     : base(PropertyNames.ListStyle)
 {
     _inherited = true;
     _type      = new CSSListStyleTypeProperty();
     _image     = new CSSListStyleImageProperty();
     _position  = new CSSListStylePositionProperty();
 }
예제 #2
0
        protected override Boolean IsValid(CSSValue value)
        {
            if (value == CSSValue.Inherit)
            {
                return(true);
            }

            var list       = value as CSSValueList ?? new CSSValueList(value);
            var index      = 0;
            var startGroup = new List <CSSProperty>(3);
            var type       = new CSSListStyleTypeProperty();
            var image      = new CSSListStyleImageProperty();
            var position   = new CSSListStylePositionProperty();

            startGroup.Add(type);
            startGroup.Add(image);
            startGroup.Add(position);

            while (true)
            {
                var length = startGroup.Count;

                for (int i = 0; i < length; i++)
                {
                    if (CheckSingleProperty(startGroup[i], index, list))
                    {
                        startGroup.RemoveAt(i);
                        index++;
                        break;
                    }
                }

                if (length == startGroup.Count)
                {
                    break;
                }
            }

            if (index == list.Length)
            {
                _type     = type;
                _image    = image;
                _position = position;
                return(true);
            }

            return(false);
        }