Automation.UI.Tree.SearchEngines.DefaultSearchEngine.GetFirstResult C# (CSharp) 메소드

GetFirstResult() 공개 메소드

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.
리턴 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);
        }