예제 #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);
                }
            }
예제 #2
0
 public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     if (base.match == null)
     {
         base.match = element;
     }
     return(true);
 }
예제 #3
0
 protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
 {
     if (match == null)
     {
         match = element;
     }
     return(true);
 }
예제 #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);
 }
예제 #5
0
            protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
            {
                ++matchCount;
                if (matchCount == _matchIndex)
                {
                    match = element;
                }

                return(matchCount >= _matchIndex);
            }
예제 #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);
                }
예제 #7
0
                protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
                {
                    T castedElement = element as T;

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

                    return(false);
                }
예제 #8
0
                public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element)
                {
                    T castedElement = element as T;

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

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