protected TreeEnumerator(T root, ITreeEnumeratorAdvisor <T> treeAdvisor) { if (root == null) { throw new ArgumentNullException(nameof(root)); } Root = new RootEnumerator(root); TreeAdvisor = treeAdvisor ?? throw new ArgumentNullException(nameof(treeAdvisor)); }
public void Dispose() { if (TreeAdvisor == null) { return; } TreeAdvisor = null; Root = RootEnumerator.Empty; Stack?.Clear(); }
protected TreeEnumerator(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> treeAdvisor) { Root = new RootEnumerator(treeItemsEnumerator); TreeAdvisor = treeAdvisor ?? throw new ArgumentNullException(nameof(treeAdvisor)); }