private bool Step() { if (_tree == null) { return(false); } if (_sub != null) { if (_sub.Step()) { return(true); } _sub = null; } if (_index < 0 && !_hasVisitedTree && _order == Order.PREORDER) { _hasVisitedTree = true; return(true); } while (++_index < _tree.MemberCount) { Tree e = (_tree.Members[_index] as Tree); if (e != null) { _sub = new TreeIterator(e, _order, _visitTreeNodes); if (_sub.HasNextTreeEntry()) { return(true); } _sub = null; continue; } return(true); } if (_index == _tree.MemberCount && !_hasVisitedTree && _order == Order.POSTORDER) { _hasVisitedTree = true; return(true); } return(false); }