示例#1
0
        private void AddWindowsBy(List <Window> windows, ControlType controlType)
        {
            List <AutomationElement> children = Finder.Children(AutomationSearchCondition.ByControlType(controlType));

            foreach (AutomationElement childElement in children)
            {
                windows.Add(Create(childElement, InitializeOption.NoCache, new NullWindowSession()));
            }
        }
        private void AddWindowsBy(List <Window> windows, ControlType controlType)
        {
            var children = Finder.Children(AutomationSearchCondition.ByControlType(controlType));

            windows.AddRange(children.Select(childElement => Create(childElement, InitializeOption.NoCache, new NullWindowSession())));
        }