示例#1
0
        /// <summary>
        /// Finds the first element which is in the given treescope with the given condition within the given timeout period.
        /// </summary>
        public AutomationElement FindFirst(TreeScope treeScope, ConditionBase condition, TimeSpan?timeout = null)
        {
            bool WhilePredicate(AutomationElement element) => element == null;
            AutomationElement RetryMethod() => FrameworkAutomationElement.FindFirst(treeScope, condition);

            return(Retry.While(RetryMethod, WhilePredicate, timeout));
        }
 /// <summary>
 /// Finds the first element which is in the given treescope with the given condition.
 /// </summary>
 public SHAutomationElement FindFirstBase(TreeScope treeScope, ConditionBase condition)
 {
     try
     {
         return(FrameworkAutomationElement.FindFirst(treeScope, condition));
     }
     catch (System.Runtime.InteropServices.COMException)
     {
         return(null);
     }
 }
示例#3
0
 /// <inheritdoc />
 public AutomationElement FindFirst(TreeScope treeScope, ConditionBase condition)
 {
     return(FrameworkAutomationElement.FindFirst(treeScope, condition));
 }