public override List <Window> ModalWindows() { var descendants = new AutomationElementFinder(automationElement) .Children(new AutomationSearchConditionFactory().GetWindowSearchConditions(automationElement.Current.ProcessId).ToArray()); return(descendants .Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache))) .ToList()); }
/// <summary> /// Recursively gets all the descendant windows. /// </summary> /// <returns></returns> /// <exception cref="UIItemSearchException">The application type is not supported by White</exception> // from ChildWindowFactory.Create public virtual List <Window> ModalWindows() { var finder = new AutomationElementFinder(automationElement); var descendants = finder.Descendants(AutomationSearchCondition.ByControlType(ControlType.Window)); return(descendants .Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache))) .ToList()); }
/// <summary> /// Recursively gets all the descendant windows. /// </summary> /// <returns></returns> public virtual List <Window> ModalWindows() { var modalWindows = new List <Window>(); var finder = new AutomationElementFinder(automationElement); var descendants = finder.Descendants(AutomationSearchCondition.ByControlType(ControlType.Window)); foreach (AutomationElement descendant in descendants) { modalWindows.Add(ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache))); } return(modalWindows); }