Back to Class Reference home page
MVVMbasics.Services.ITimerService
MVVMbasics.Services.TimerService
[MvvmService]
public class TimerService : ITimerService
Service which provides timer methods.
Method Summary | |
---|---|
Guid |
StartOnce(TimeSpan interval, Action callback)
Creates a new timer that will run once, and starts it. |
Guid |
StartLooping(TimeSpan interval, Action callback)
Creates a new timer that will start over again, and starts it. |
void |
Stop(params Guid[] ids)
Stops some or all timers. |
Method Detail |
---|
public Guid StartOnce(TimeSpan interval, Action callback)
Creates a new timer that will run once, and starts it.
interval
- Timer interval.
callback
- Method to be executed on the timer tick event.
public Guid StartLooping(TimeSpan interval, Action callback)
Creates a new timer that will start over again, and starts it.
interval
- Timer interval.
callback
- Method to be executed on each timer tick event.
public void Stop(params Guid[] ids)
Stops some or all timers.
ids
- IDs of those timers that shall be stopped and removed. If not provided, all existing timers will be stopped and removed.