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); } }
public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { if (base.match == null) { base.match = element; } return(true); }
protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { if (match == null) { match = element; } return(true); }
public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { this.matchCount++; if (this.matchCount == this._matchIndex) { base.match = element; } return(this.matchCount >= this._matchIndex); }
protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { ++matchCount; if (matchCount == _matchIndex) { match = element; } return(matchCount >= _matchIndex); }
public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { T t = element as T; if (t != null) { this.result.Add(this.callBack(t)); } return(false); }
protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { T castedElement = element as T; if (castedElement != null) { result.Add(callBack(castedElement)); } return(false); }
public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { T castedElement = element as T; if (castedElement != null) { callBack(castedElement); } return(false); }
protected virtual bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { return(false); }
protected override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { matches.Add(element as T); return(false); }
public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { match = element; return(false); }
public override bool OnRuleMatchedElement(RuleMatcher matcher, VisualElement element) { this.matches.Add(element as T); return(false); }