Ejemplo n.º 1
0
        public new bool WaitFor(SomethingToWaitFor check, FailureToHappenHandler failureHandler)
        {
            _expandCollapsePattern.Expand();
            var result = base.WaitFor(check, failureHandler);

            _expandCollapsePattern.Collapse();
            return(result);
        }
Ejemplo n.º 2
0
        public T WaitForElement <T>(Condition condition, FailureToHappenHandler handler) where T : AutomationElementWrapper
        {
            T element = null;

            WaitFor((s, ev) =>
            {
                element = _finder.Find <T>(this, condition, ex => { });
                return(element != null);
            },
                    handler);
            return(element);
        }
Ejemplo n.º 3
0
        public bool WaitFor(AutomationElementWrapper element, SomethingToWaitFor check, TimeSpan timeout, FailureToHappenHandler failureHandler, IEnumerable<AutomationEventWrapper> events)
        {
            Monitor.Enter(_waitingRoom);
            _triggeringEvent = null;

            DateTime started = DateTime.Now;
            var handlerRemovers = AddPulsingHandlers(events, element);

            bool checkPassed = true;
            while (!check(element, _triggeringEvent) && DateTime.Now.Subtract(started).CompareTo(timeout) < 0)
            {
                checkPassed = false;
                Monitor.Wait(_waitingRoom, timeout);
            }
            Monitor.Exit(_waitingRoom);
            ClearPulsingHandlers(handlerRemovers);

            if (!checkPassed && !check(element, null))
            {
                failureHandler(element);
                return false;
            }
            return true;
        }
Ejemplo n.º 4
0
 public new bool WaitFor(SomethingToWaitFor check, FailureToHappenHandler failureHandler)
 {
     var result = base.WaitFor(check, failureHandler);
     return result;
 }
Ejemplo n.º 5
0
 public new bool WaitFor(SomethingToWaitFor check, FailureToHappenHandler failureHandler)
 {
     _expandCollapsePattern.Expand();
     var result = base.WaitFor(check, failureHandler);
     _expandCollapsePattern.Collapse();
     return result;
 }
Ejemplo n.º 6
0
 public bool WaitFor(SomethingToWaitFor check, TimeSpan timeout, FailureToHappenHandler failureHandler, IEnumerable<AutomationEventWrapper> events)
 {
     return _waiter.WaitFor(this, check, timeout, failureHandler, events);
 }
Ejemplo n.º 7
0
 public bool WaitFor(SomethingToWaitFor check, TimeSpan timeout, FailureToHappenHandler failureHandler)
 {
     return WaitFor(check, timeout, failureHandler, SensibleEventsToWaitFor);
 }
Ejemplo n.º 8
0
 public bool WaitFor(SomethingToWaitFor check, FailureToHappenHandler failureHandler)
 {
     return WaitFor(check, DefaultWaitTimeout, failureHandler);
 }
Ejemplo n.º 9
0
        public new bool WaitFor(SomethingToWaitFor check, FailureToHappenHandler failureHandler)
        {
            var result = base.WaitFor(check, failureHandler);

            return(result);
        }
Ejemplo n.º 10
0
        public bool WaitFor(AutomationElementWrapper element, SomethingToWaitFor check, TimeSpan timeout, FailureToHappenHandler failureHandler, IEnumerable <AutomationEventWrapper> events)
        {
            Monitor.Enter(_waitingRoom);
            _triggeringEvent = null;

            DateTime started         = DateTime.Now;
            var      handlerRemovers = AddPulsingHandlers(events, element);

            bool checkPassed = true;

            while (!check(element, _triggeringEvent) && DateTime.Now.Subtract(started).CompareTo(timeout) < 0)
            {
                checkPassed = false;
                Monitor.Wait(_waitingRoom, timeout);
            }
            Monitor.Exit(_waitingRoom);
            ClearPulsingHandlers(handlerRemovers);

            if (!checkPassed && !check(element, null))
            {
                failureHandler(element);
                return(false);
            }
            return(true);
        }
Ejemplo n.º 11
0
 public bool WaitFor(SomethingToWaitFor check, TimeSpan timeout, FailureToHappenHandler failureHandler, IEnumerable <AutomationEventWrapper> events)
 {
     return(_waiter.WaitFor(this, check, timeout, failureHandler, events));
 }
Ejemplo n.º 12
0
 public bool WaitFor(SomethingToWaitFor check, TimeSpan timeout, FailureToHappenHandler failureHandler)
 {
     return(WaitFor(check, timeout, failureHandler, SensibleEventsToWaitFor));
 }
Ejemplo n.º 13
0
 public bool WaitFor(SomethingToWaitFor check, FailureToHappenHandler failureHandler)
 {
     return(WaitFor(check, DefaultWaitTimeout, failureHandler));
 }