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); }
public override StyleSpecificity CalculateSpecificity() { return(Ascendant.CalculateSpecificity() + Descendant.CalculateSpecificity()); }