Beispiel #1
0
        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());
        }
Beispiel #2
0
        /// <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());
        }
Beispiel #3
0
        /// <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);
        }