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

GetFirstResult() public method

Gets the first result for the specified query. Uses the FindFirst method.
public GetFirstResult ( Query query, System.TimeSpan timeout ) : AutomationElement
query Query The query.
timeout System.TimeSpan The maximum amount of time to wait for the required element to become available.
return System.Windows.Automation.AutomationElement
        public override AutomationElement GetFirstResult(Query query, TimeSpan timeout)
        {
            Debug.WriteLine("FirstResult - " + query, "UIAutomation-SearchEngine-Default");

            var root = query.Root;
            var scope = query.Scope;
            var conditions = query.Conditions;
            return (AutomationElement) ExecuteGetResult(() => root.FindFirst(scope, conditions), timeout);
        }