Automation.UI.Tree.SearchEngines.DefaultSearchEngine.GetAllResults C# (CSharp) Method

GetAllResults() public method

Gets all the automation elements found using the condition specified in the specified query. Uses the FindAll method.
public GetAllResults ( Query query, System.TimeSpan timeout ) : IEnumerable
query Query The query.
timeout System.TimeSpan The maximum amount of time to wait for at least one element to become available.
return IEnumerable
        public override IEnumerable GetAllResults(Query query, TimeSpan timeout)
        {
            Debug.WriteLine("AllResults - " + query, "UIAutomation-SearchEngine-Default");

            var root = query.Root;
            var scope = query.Scope;
            var conditions = query.Conditions;
            return (IEnumerable) ExecuteGetResult(() => {
                var children = root.FindAll(scope, conditions);
                return children.Count > 0 ? children : null;
            }, timeout);
        }