Exemplo n.º 1
0
 internal CSSTextDecorationProperty()
     : base(PropertyNames.TextDecoration)
 {
     _style     = new CSSTextDecorationStyleProperty();
     _line      = new CSSTextDecorationLineProperty();
     _color     = new CSSTextDecorationColorProperty();
     _inherited = false;
 }
Exemplo n.º 2
0
        protected override Boolean IsValid(CSSValue value)
        {
            if (value == CSSValue.Inherit)
            {
                return(true);
            }

            var list = value as CSSValueList;

            if (list == null)
            {
                list = new CSSValueList(value);
            }

            var index      = 0;
            var startGroup = new List <CSSProperty>(3);
            var style      = new CSSTextDecorationStyleProperty();
            var line       = new CSSTextDecorationLineProperty();
            var color      = new CSSTextDecorationColorProperty();

            startGroup.Add(style);
            startGroup.Add(line);
            startGroup.Add(color);

            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)
            {
                _style = style;
                _line  = line;
                _color = color;
                return(true);
            }

            return(false);
        }