Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
        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();
            }
        }
Exemplo n.º 3
0
        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);
        }