0

The Dispatcher class maintains an internal List<DispatcherTimer> for active timers. The internal Dispatcher.AddTimer() method adds it, called on the Start() method. RemoveTimer() is called by the Stop() method.

I need to clear that internal List<DispatcherTimer>. Is it possible to Stop/Remove all timers in the Dispatcher?

Jakub
  • 285
  • 4
  • 21
  • 1
    Why do not call `Stop()` for all timers? What are you trying to do ([X problem](http://meta.stackexchange.com/q/66377/299295))? – Sinatr Apr 26 '16 at 11:41
  • Basically I register some DispatcherTimers for notifications every minute (inside another Timer) and I dont want them to be fired more than once. Therefore I need to clear them every minute, before I register new ones. Is it at least a bit clear? – Jakub Apr 26 '16 at 11:47
  • And of course I call Stop() for all of them, but I need to Stop some of them before they are fired. – Jakub Apr 26 '16 at 11:49
  • 1
    You describe *how you do* something (using `DispatcherTimer`), but you didn't answer what problem you are trying to solve. Why do you need to stop timers? Maybe using timer is not a good idea? Maybe a simple cancelable `Task` will do? – Sinatr Apr 26 '16 at 14:15

0 Answers0