Exemplo n.º 1
0
 internal CSSColumnsProperty()
     : base(PropertyNames.Columns)
 {
     _inherited = false;
     _count     = new CSSColumnCountProperty();
     _width     = new CSSColumnWidthProperty();
 }
Exemplo n.º 2
0
        protected override Boolean IsValid(CSSValue value)
        {
            if (value == CSSValue.Inherit)
            {
                return(true);
            }

            var index      = 0;
            var list       = value as CSSValueList ?? new CSSValueList(value);
            var startGroup = new List <CSSProperty>(2);
            var width      = new CSSColumnWidthProperty();
            var count      = new CSSColumnCountProperty();

            startGroup.Add(width);
            startGroup.Add(count);

            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)
            {
                _width = width;
                _count = count;
                return(true);
            }

            return(false);
        }