public void CollectConditionTargets(IStyledObject node, IWatchRuleFactory watchRuleFactory, ICollection <IWatchRule> affectedNodes) { Selector.CollectConditionTargets(node, watchRuleFactory, affectedNodes); var parent = node.GetStyleParent(); while (parent != null) { AnchestorSelector.CollectConditionTargets(parent, watchRuleFactory, affectedNodes); if (DirectChild) { break; } parent = parent.GetStyleParent(); } }
public bool Matches(IStyledObject styledObject) { if (!Selector.Matches(styledObject)) { return(false); } var parent = styledObject.GetStyleParent(); while (parent != null) { if (AnchestorSelector.Matches(parent)) { return(true); } if (DirectChild) { return(false); } parent = parent.GetStyleParent(); } return(false); }