Beispiel #1
0
        /// <summary>
        /// Finds all elements in the given treescope and with the given condition within the given timeout.
        /// </summary>
        public AutomationElement[] FindAll(TreeScope treeScope, ConditionBase condition, TimeSpan?timeout = null)
        {
            bool WhilePredicate(AutomationElement[] elements) => elements.Length == 0;

            AutomationElement[] RetryMethod() => FrameworkAutomationElement.FindAll(treeScope, condition);

            return(Retry.While(RetryMethod, WhilePredicate, timeout) ?? new AutomationElement[0]);
        }
 private SHAutomationElement[] FindAllBase(TreeScope treeScope, ConditionBase condition)
 {
     try
     {
         return(FrameworkAutomationElement.FindAll(treeScope, condition));
     }
     catch (System.Runtime.InteropServices.COMException)
     {
         return(Array.Empty <SHAutomationElement>());
     }
 }
Beispiel #3
0
 /// <inheritdoc />
 public AutomationElement[] FindAll(TreeScope treeScope, ConditionBase condition)
 {
     return(FrameworkAutomationElement.FindAll(treeScope, condition));
 }