internal static bool IsOwnerOf(BasicWindow window, BasicElement potentialChildElement) { var condition = By.Condition(e => e.Properties.NativeWindowHandle == window.Properties.NativeWindowHandle); var settings = With.NoAssert().And.NoTimeout(); var element = potentialChildElement.GetParent(condition, settings); return(element != null); }
/// <summary> /// Returns all available child elements, no matter their position the child tree, as a plain list. /// </summary> /// <typeparam name="TControl">The UI element types.</typeparam> /// <param name="from">The source where the child elements belongs to.</param> /// <returns>A list of all available child elements.</returns> public static IEnumerable <TControl> GetDescendants <TControl>(From from) where TControl : BasicElement { return(GetChildren <TControl>(By.Condition(p => true), from, With.NoAssert().NoTimeout().NoInterval())); }