Class Timer
Implements a timer that raises an event at user-defined intervals. This timer is optimized for use in AlterNET UI applications and must be used in a GUI environment instead of any other timers.
public class Timer : FrameworkElement, IBaseObjectWithId, IDisposableObject, IBaseObject, IComponent, IDisposable
- Inheritance
-
Timer
- Implements
Constructors
- Timer(int)
Initializes a new instance of the Timer class with the specified tick interval (in milliseconds).
- Timer(int, EventHandler)
Initializes a new instance of the Timer class with the specified tick interval (in milliseconds) and Tick handler.
- Timer(TimeSpan)
Initializes a new instance of the Timer class with the specified tick interval.
- Timer(TimeSpan, EventHandler)
Initializes a new instance of the Timer class with the specified tick interval and Tick handler.
Properties
- AutoReset
Gets or sets a bool indicating whether the Timer should raise events only once (false) or repeatedly (true).
- Enabled
Gets or sets whether the timer is running.
- Handler
Gets native timer.
- IntervalAsTimeSpan
Gets or sets the time duration, before the Tick event is raised relative to the last occurrence of the Tick event.
- TickAction
Gets or sets action which is called when timer interval has elapsed.
Methods
- DisposeManaged()
Override to dispose managed resources. Here we dispose all used object references.
- OnTick(EventArgs)
Raises the Tick event.
- Start()
Starts the timer.
- StartOnce()
Starts the timer which will raise tick event only once.
- StartRepeated()
Starts the timer which will raise tick events repeatedly.
- Stop()
Stops the timer.
Events
- Elapsed
Occurs when the specified timer interval has elapsed.
- Tick
Occurs when the specified timer interval has elapsed.