public static T GetSibling <T>(this IUIItem childElement, SearchCriteria searchCriteria) where T : IUIItem { var element = childElement.GetParent <IUIItem>(); var parentContainer = new UIItemContainer(element.AutomationElement, element.ActionListener); return((T)parentContainer.Get(searchCriteria)); }
public static IEnumerable <IUIItem> Ancestors(this IUIItem item) { var parent = item.GetParent <IUIItemContainer>(); while (parent != null) { yield return(parent); parent = parent.GetParent <IUIItemContainer>(); } }