public override int GetHashCode() { unchecked { var hashCode = DirectChild.GetHashCode(); hashCode = (hashCode * 397) ^ (Selector != null ? Selector.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AnchestorSelector != null ? AnchestorSelector.GetHashCode() : 0); return(hashCode); } }
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); }