public void ShouldInvokeFinishedActionAfterAction() { const int delay = 10; Invoke.Later(() => { }, delay, TestFinishAction); AssertFinishActionIsInvoked(delay); }
private void ScheduleBusyMessageAnimation() { if (IsBusy) { Invoke.Later( () => { _suffixIndex = (_suffixIndex + 1) % _suffixes.Length; RaisePropertyChanged(self => self.BusyMessageAnimated); }, AnimationRefreshDelayInMillis, ScheduleBusyMessageAnimation); } }
/// <summary> /// Invoked when the completion is closed, regardless of whether an item was applied or the completion was /// cancelled. In the former case, invocation occurs before that of <see cref="HandleItemCompleted" />. Therefore, /// it defers the notification of the handler(s) for some time, to make sure any <see cref="HandleItemCompleted" /> /// event arives first. /// </summary> private void HandleClosed(object sender, EventArgs eventArgs) { var isEscapePressed = Key.Escape.IsPressed(); OnClosed(); if (isEscapePressed) { _terminationTrigger = EventTrigger.Shortcut; OnCancel(); } else { _delayedCancelAction = Invoke.Later(OnCancel, 10000); } }
public void ShouldInvokeImmediatelyWhenScheduledForPastDate() { Invoke.Later(TestAction, System.DateTime.Now.AddSeconds(-5)); AssertActionIsInvoked(0); }
public void ShouldInvokeActionImmediatelyWhenScheduledForNow() { Invoke.Later(TestAction, System.DateTime.Now); AssertActionIsInvoked(0); }
public void ShouldInvokeActionAfterExplicitDelay(int delay) { Invoke.Later(TestAction, delay); AssertActionIsInvoked(delay); }
public void ShouldInvokeImmediatelyWhenScheduledWithNegativeDelay() { Invoke.Later(TestAction, -5); AssertActionIsInvoked(0); }
public void ShouldInvokeActionImmediatelyWhenScheduledWithNoDelay() { Invoke.Later(TestAction, 0); AssertActionIsInvoked(0); }
public void ShouldInvokeActionOnScheduleDate(int delay) { Invoke.Later(TestAction, System.DateTime.Now.AddMilliseconds(delay)); AssertActionIsInvoked(delay); }
public ScheduledAction RegisterCallback(Action callback, DateTime timeForCallbackInvocation, Action finishedAction) { return(Invoke.Later(callback, timeForCallbackInvocation, finishedAction)); }
public ScheduledAction RegisterCallback(Action callback, int delayInMillisecond) { return(Invoke.Later(callback, delayInMillisecond)); }