AnimationTimer
Namespace: Hex1b.Animation
Assembly: Hex1b.dll
Manages one-shot animation timers for triggering widget redraws.
public sealed class AnimationTimerInheritance
Object → AnimationTimer
Constructors
AnimationTimer()
Creates an AnimationTimer with the default minimum interval (16ms).
public AnimationTimer()AnimationTimer(TimeSpan)
Creates an AnimationTimer with a custom minimum interval.
Parameters:
minimumInterval(TimeSpan): The minimum interval between frames. Values below 1ms are clamped to 1ms.
public AnimationTimer(TimeSpan minimumInterval)Properties
HasScheduledTimers
Gets whether any timers are currently scheduled.
Returns: Boolean
public bool HasScheduledTimers { get; }MinimumInterval
Gets the minimum interval between frames for this timer.
Returns: TimeSpan
public TimeSpan MinimumInterval { get; }Methods
Clear()
Clears all scheduled timers without firing them.
public void Clear()FireDue()
Fires all timers that are due and removes them from the queue.
Returns: Int32
The number of timers that were fired.
public int FireDue()GetTimeUntilNextDue()
Gets the time until the next timer is due, or null if no timers are scheduled.
Returns: Nullable<TimeSpan>
TimeSpan until next timer, or null if no timers. Returns TimeSpan.Zero if a timer is already due.
public TimeSpan? GetTimeUntilNextDue()Schedule(TimeSpan, Action)
Schedules a one-shot timer that fires after the specified delay.
Parameters:
delay(TimeSpan): The delay before firing. Clamped to minimum interval.callback(Action): The callback to invoke when the timer fires.
public void Schedule(TimeSpan delay, Action callback)Fields
AbsoluteMinimumInterval
Absolute minimum interval (1ms) to prevent CPU spin.
Returns: TimeSpan
public static readonly TimeSpan AbsoluteMinimumIntervalDefaultMinimumInterval
Default minimum interval between frames (16ms = ~60 FPS).
Returns: TimeSpan
public static readonly TimeSpan DefaultMinimumIntervalRemarks
AnimationTimer maintains a list of scheduled callbacks and provides integration with the Hex1bApp run loop. Timers are one-shot - they fire once and are removed.
A minimum interval is enforced to prevent CPU spin from overly aggressive animation requests. The default is 16ms (~60 FPS) but can be configured via .