/// <summary>Stops the given timer.</summary> /// <param name="timer">The timer to stop.</param> public static void Stop(GuiTimer timer) { if (timer != null) timer.Stop(); }
/// <summary>Starts a timer that will be invoked when the application is idle.</summary> /// <param name="callback">The timer callback.</param> /// <returns>The <see cref="GuiTimer"/> object that can be used for stopping the timer. </returns> public static GuiTimer StartOnIdle(GuiTimerCallback callback) { var timer = new GuiTimer(DispatcherPriority.ApplicationIdle); timer.Start(callback); return timer; }
/// <summary>Starts a timer that will be invoked after the next layout and rendering pass.</summary> /// <param name="callback">The timer callback.</param> /// <returns>The <see cref="GuiTimer"/> object that can be used for stopping the timer. </returns> public static GuiTimer StartAfterRender(GuiTimerCallback callback) { var timer = new GuiTimer(DispatcherPriority.Loaded); timer.Start(callback); return timer; }
/// <summary>Starts a timer that will be invoked before the next layout and rendering pass.</summary> /// <param name="callback">The timer callback.</param> /// <returns>The <see cref="GuiTimer"/> object that can be used for stopping the timer. </returns> public static GuiTimer StartBeforeRender(GuiTimerCallback callback) { var timer = new GuiTimer(DispatcherPriority.DataBind); timer.Start(callback); return timer; }
/// <summary>Starts a timer that will be invoked after a specified delay.</summary> /// <param name="delay">The timer delay.</param> /// <param name="callback">The timer callback.</param> /// <returns>The <see cref="GuiTimer"/> object that can be used for stopping the timer. </returns> public static GuiTimer StartAfter(TimeSpan delay, GuiTimerCallback callback) { var timer = new GuiTimer(); timer.Start(delay, callback); return timer; }