I have a System.Timers.Timer setup like so:
Code:
System.Timers.Timer timer = new System.Timers.Timer();
timer.AutoReset = false;
timer.Interval = frametime;
timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
I than start the timer only once calling the timer.Start() method and after the period of time specified it executes the event and than stops like it is suposed to. However in that event I set the interval of the timer to a different value like so:
Code:
if (currentframe == framecount - 1)
{
timer.Interval = framepausetime;
}
else
{
timer.Interval = frametime;
}
When I set the interval it starts the timer again without me calling Start. I checked to make sure that it wasn't enabled and it is not enabled when I set the interval. Why does it keep starting when I set the interval?
It also apears that calling Stop() on the timer doesn't stop it.