示例#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);
 }