public void EndView() { if (this.m_ViewStates.Count < 1) { Debug.Assert(this.m_CurrentContainer == this.topLevelVisualContainer); if (this.verbose) { Debug.LogError("Unexpected call to EndView()"); } } else { if (this.m_CurrentContainer.childrenCount > this.m_CurrentViewState.childIndex) { this.RecycleDescendants(this.m_CurrentContainer, this.m_CurrentViewState.childIndex); } Debug.Assert(this.m_CurrentContainer.parent != null); if (this.m_CurrentContainer is IMScrollView) { VisualContainer parent = this.m_CurrentContainer.parent; IMScrollView iMScrollView = parent as IMScrollView; while (parent != null && iMScrollView == null) { parent = parent.parent; iMScrollView = (parent as IMScrollView); } this.currentScrollView = iMScrollView; } this.m_CurrentViewState = this.m_ViewStates.Pop(); this.m_CurrentContainer = this.m_CurrentContainer.parent; } }
public VisualTreeBuilder(Recycler r) { this.m_ElementPool = r; this.m_ViewStates = new Stack <VisualTreeBuilder.ViewState>(); this.m_CurrentContainer = null; this.m_CurrentViewState = new VisualTreeBuilder.ViewState(0); this.topLevelVisualContainer = null; this.verbose = false; this.currentScrollView = null; }
public void NextView <TType>(out TType view) where TType : IMContainer, new() { this.NextElement <TType>(out view); this.m_CurrentContainer = view; this.m_ViewStates.Push(this.m_CurrentViewState); this.m_CurrentViewState = new VisualTreeBuilder.ViewState(0); IMScrollView iMScrollView = this.m_CurrentContainer as IMScrollView; if (iMScrollView != null) { this.currentScrollView = iMScrollView; } }