public static IEnumerable <IAccessible> GetDescendants(this IAccessible element) { Stack <IEnumerator <IAccessible> > enumerators = new Stack <IEnumerator <IAccessible> >(); enumerators.Push(element.GetChildren().GetEnumerator()); while (enumerators.Count > 0) { var enumerator = enumerators.Peek(); if (!enumerator.MoveNext()) { enumerators.Pop(); } else { var decendant = enumerator.Current; if (decendant == null) { continue; } yield return(decendant); enumerators.Push(decendant.GetChildren().GetEnumerator()); } } }
private static void DumpValuesRecursive(IAccessible accessible, int indent) { DumpAccessible(accessible, indent); foreach (var child in accessible.GetChildren()) { DumpValuesRecursive(child, indent + 2); } }
private static void DumpValuesRecursive(IAccessible accessible, int indent) { DumpAccessible(accessible, indent); foreach (var child in accessible.GetChildren()) DumpValuesRecursive(child, indent + 2); }