public static void ReverseVisit <T>(this ITreeEnumeratorAdvisor <T> iteratorAdvisor, IEnumerator <T> treeItemsEnumerator, Action <T, AncestorsEnumerator <T> > visitor) where T : class { using var enumerator = TreeEnumerator.GetReverseEnumerator(treeItemsEnumerator, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current, enumerator.CurrentAncestors); } }
public static void Visit <T>(T root, ITreeEnumeratorAdvisor <T> iteratorAdvisor, Action <T, AncestorsEnumerator <T> > visitor) { using var enumerator = GetEnumerator(root, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current, enumerator.CurrentAncestors); } }
public static void Visit <T>(this ITreeEnumeratorAdvisor <T> iteratorAdvisor, T root, Action <T, AncestorsEnumerator <T> > visitor) where T : class { using var enumerator = TreeEnumerator.GetEnumerator(root, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current, enumerator.CurrentAncestors); } }
public static void ReverseVisit <T>(T root, ITreeEnumeratorAdvisor <T> iteratorAdvisor, Action <T> visitor) { using var enumerator = GetReverseEnumerator(root, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current); } }
public static void ReverseVisit <T>(this ITreeEnumeratorAdvisor <T> iteratorAdvisor, T root, Action <T> visitor) where T : class { using var enumerator = TreeEnumerator.GetReverseEnumerator(root, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current); } }
public static void ReverseVisit <T>(IEnumerable <T> treeItems, ITreeEnumeratorAdvisor <T> iteratorAdvisor, Action <T, AncestorsEnumerator <T> > visitor) { using var enumerator = GetReverseEnumerator(treeItems, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current, enumerator.CurrentAncestors); } }
public static void Visit <T>(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> iteratorAdvisor, Action <T> visitor) { using var enumerator = GetEnumerator(treeItemsEnumerator, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current); } }
public static void Visit <T>(this ITreeEnumeratorAdvisor <T> iteratorAdvisor, IEnumerable <T> treeItems, Action <T> visitor) where T : class { using var enumerator = TreeEnumerator.GetEnumerator(treeItems, iteratorAdvisor); while (enumerator.MoveNext()) { visitor(enumerator.Current); } }
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(); }
public static ITreeEnumerator <T> GetEnumerator <T>(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> treeAdvisor) { return(new DirectTreeEnumerator <T>(treeItemsEnumerator, treeAdvisor)); }
public static ITreeEnumerator <T> GetReverseEnumerator <T>(this ITreeEnumeratorAdvisor <T> advisor, T root) where T : class { return(TreeEnumerator.GetReverseEnumerator(root, advisor)); }
protected TreeEnumerator(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> treeAdvisor) { Root = new RootEnumerator(treeItemsEnumerator); TreeAdvisor = treeAdvisor ?? throw new ArgumentNullException(nameof(treeAdvisor)); }
public DirectTreeEnumerator(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> treeAdvisor) : base(treeItemsEnumerator, treeAdvisor) { }
public static NodeEnumerator Create(T node, ITreeEnumeratorAdvisor <T> advisor) { return(new NodeEnumerator(node, advisor.GetChildren(node))); }
public static ITreeEnumerator <T> GetReverseEnumerator <T>(this ITreeEnumeratorAdvisor <T> advisor, IEnumerator <T> treeItemsEnumerator) where T : class { return(TreeEnumerator.GetReverseEnumerator(treeItemsEnumerator, advisor)); }
public DirectTreeEnumerator(T root, ITreeEnumeratorAdvisor <T> treeAdvisor) : base(root, treeAdvisor) { }
public ReverseTreeEnumerator(T root, ITreeEnumeratorAdvisor <T> treeAdvisor) : base(root, treeAdvisor) { }
public static ITreeEnumerator <T> GetReverseEnumerator <T>(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> treeAdvisor) { return(new ReverseTreeEnumerator <T>(treeItemsEnumerator, treeAdvisor)); }
public static ITreeEnumerator <T> GetReverseEnumerator <T>(T root, ITreeEnumeratorAdvisor <T> treeAdvisor) { return(new ReverseTreeEnumerator <T>(root, treeAdvisor)); }
public ReverseTreeEnumerator(IEnumerator <T> treeItemsEnumerator, ITreeEnumeratorAdvisor <T> treeAdvisor) : base(treeItemsEnumerator, treeAdvisor) { }
public static ITreeEnumerator <T> GetEnumerator <T>(T root, ITreeEnumeratorAdvisor <T> treeAdvisor) { return(new DirectTreeEnumerator <T>(root, treeAdvisor)); }