From d7cf2bfb4b58cf9a4a4a5413c927712a0e2ed9ca Mon Sep 17 00:00:00 2001 From: Jake Ginnivan Date: Tue, 10 Jun 2014 22:06:08 +0100 Subject: [PATCH] Revert #221 as it is causing more problems --- .../AutomationElementFinder.cs | 3 ++- .../UIItems/WindowItems/Win32Window.cs | 23 +++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/TestStack.White/AutomationElementSearch/AutomationElementFinder.cs b/src/TestStack.White/AutomationElementSearch/AutomationElementFinder.cs index 0d3a37ce..c0537065 100644 --- a/src/TestStack.White/AutomationElementSearch/AutomationElementFinder.cs +++ b/src/TestStack.White/AutomationElementSearch/AutomationElementFinder.cs @@ -26,7 +26,8 @@ public virtual AutomationElement AutomationElement public virtual List Children(params AutomationSearchCondition[] automationSearchConditions) { - return new MultiLevelAutomationElementFinder(automationSearchConditions).FindAll(automationElement).Cast().ToList(); + return new MultiLevelAutomationElementFinder(automationSearchConditions) + .FindAll(automationElement); } public virtual AutomationElement Child(params AutomationSearchCondition[] automationSearchConditions) diff --git a/src/TestStack.White/UIItems/WindowItems/Win32Window.cs b/src/TestStack.White/UIItems/WindowItems/Win32Window.cs index feb8d73a..22e8da34 100644 --- a/src/TestStack.White/UIItems/WindowItems/Win32Window.cs +++ b/src/TestStack.White/UIItems/WindowItems/Win32Window.cs @@ -39,15 +39,20 @@ public override Window ModalWindow(string title, InitializeOption option) WindowSession.ModalWindowSession(option)); } - public override List 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(); - } + //TODO Try and get this working + //public override List ModalWindows() + //{ + // var automationSearchConditions = new AutomationSearchConditionFactory() + // .GetWindowSearchConditions(automationElement.Current.ProcessId) + // .ToArray(); + + // var descendants = new AutomationElementFinder(automationElement) + // .Children(automationSearchConditions); + + // return descendants + // .Select(descendant => ChildWindowFactory.Create(descendant, InitializeOption.NoCache, WindowSession.ModalWindowSession(InitializeOption.NoCache))) + // .ToList(); + //} public override Window ModalWindow(SearchCriteria searchCriteria, InitializeOption option) {