Example #1
0
        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));
        }
Example #2
0
        public void Dispose()
        {
            if (TreeAdvisor == null)
            {
                return;
            }

            TreeAdvisor = null;
            Root        = RootEnumerator.Empty;
            Stack?.Clear();
        }
Example #3
0
 protected TreeEnumerator(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> treeAdvisor)
 {
     Root        = new RootEnumerator(treeItemsEnumerator);
     TreeAdvisor = treeAdvisor ?? throw new ArgumentNullException(nameof(treeAdvisor));
 }