Ejemplo n.º 1
0
            public override void TraverseRecursive(VisualElement element, int depth)
            {
                int originalCount = m_MatchersUsedInRecursion.Count;

                int count = m_MatchersUsedInRecursion.Count; // changes while we iterate so save

                for (int j = 0; j < count; j++)
                {
                    RuleMatcher matcher = m_MatchersUsedInRecursion[j];

                    if (StyleSelectorHelper.MatchRightToLeft(element, matcher.complexSelector, NoProcessResult))
                    {
                        // use by uQuery to determine if we need to stop
                        if (OnRuleMatchedElement(matcher, element))
                        {
                            return;
                        }
                    }
                }

                Recurse(element, depth);

                // Remove all matchers that we could possibly have added at this level of recursion
                if (m_MatchersUsedInRecursion.Count > originalCount)
                {
                    m_MatchersUsedInRecursion.RemoveRange(originalCount, m_MatchersUsedInRecursion.Count - originalCount);
                }
            }
Ejemplo n.º 2
0
 public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     if (base.match == null)
     {
         base.match = element;
     }
     return(true);
 }
Ejemplo n.º 3
0
 protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     if (match == null)
     {
         match = element;
     }
     return(true);
 }
Ejemplo n.º 4
0
 public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     this.matchCount++;
     if (this.matchCount == this._matchIndex)
     {
         base.match = element;
     }
     return(this.matchCount >= this._matchIndex);
 }
Ejemplo n.º 5
0
            protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
            {
                ++matchCount;
                if (matchCount == _matchIndex)
                {
                    match = element;
                }

                return(matchCount >= _matchIndex);
            }
Ejemplo n.º 6
0
                public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
                {
                    T t = element as T;

                    if (t != null)
                    {
                        this.result.Add(this.callBack(t));
                    }
                    return(false);
                }
Ejemplo n.º 7
0
                protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
                {
                    T castedElement = element as T;

                    if (castedElement != null)
                    {
                        result.Add(callBack(castedElement));
                    }

                    return(false);
                }
Ejemplo n.º 8
0
                public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
                {
                    T castedElement = element as T;

                    if (castedElement != null)
                    {
                        callBack(castedElement);
                    }

                    return(false);
                }
Ejemplo n.º 9
0
 protected virtual bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     return(false);
 }
Ejemplo n.º 10
0
 protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     matches.Add(element as T);
     return(false);
 }
Ejemplo n.º 11
0
 public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     match = element;
     return(false);
 }
Ejemplo n.º 12
0
 public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     this.matches.Add(element as T);
     return(false);
 }