0
ivanosw1 created
Hi, Is possible to change the Period of a PeriodicBackgroundWorkerBase after it has been initilized ? I would like to change it during time reading the value from database ( eg. 1 minute during day, 15 minutes during night).
Thanks.
3 Answer(s)
-
0
Hi,
Actually there is no a built-in solution for this. But may be you can try to set timer in DoWork method by a datetime condition I mean something like following:
Timer.Period = now == day ? "1 minute" : "15 minutes";
-
0
I've tried to change the Period in DoWork and it seems works. My doubt is only if this is expected or can cause some stranges side effects.
-
0
I think, it is a stable way to do this for this design.