示例#1
0
        public override bool Matches(Control control)
        {
            if (!Descendant.Matches(control))
            {
                return(false);
            }

            var parent = control.Parent;
            var found  = false;

            while (parent != null)
            {
                if (Ascendant.Matches(parent))
                {
                    found = true;
                    break;
                }

                parent = parent.Parent;
            }

            return(found);
        }
示例#2
0
 public override StyleSpecificity CalculateSpecificity()
 {
     return(Ascendant.CalculateSpecificity() + Descendant.CalculateSpecificity());
 }