Implements a secure Timer, which raises an event in defined intervals.
Inheritance Hierarchy
Un4seen.BassBASSTimer
Namespace: Un4seen.Bass
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.17.5
Syntax
The BASSTimer type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BASSTimer |
Creates a new Timer instance using a default interval of 50ms.
| |
BASSTimer(Int32) |
Creates a new Timer instance using the given interval.
|
Properties
Name | Description | |
---|---|---|
Enabled |
Gets or Sets if the Timer is currently active.
| |
Interval |
Gets or Sets the number of milliseconds between two Tick events.
|
Methods
Name | Description | |
---|---|---|
Dispose |
Implement IDisposable.
| |
Finalize |
Finalization code.
(Overrides ObjectFinalize.) | |
Start |
Activates (starts) the Timer.
| |
Stop |
Deativates (stops) the Timer.
|
Events
Name | Description | |
---|---|---|
Tick |
Event handler used to notify that the timer has elapsed.
|
Remarks
This Timer uses a Tick event handler which will be raised every Interval milliseconds once the Start method was called and the timer is activated.
This implementation ensures, that the Tick event will be executed in the main thread the subscriber executes in! So when subscribing to this event from a UI thread, the specified event delegate will also be called in that UI thread.
Use the Stop method to deactivate the Timer.
You might change the Interval at any time. If the Timer has already been activated, this will also take immediate effect (the next Tick event will be raised after the new interval value).
See Also