Timer Just Won't Die (already!)
<p>For some time now I've been having this recurrent nightmare (read - bug in my application). For some reason, a certain Timer continues to send "Elapsed" events after I stopped it, even though <strong>in the event itself</strong> the timer "admits" to having been disabled! Check this out:</p>

<pre><code>//Timer is created in Class' Constructor. Class is not static.
public PDAAccess ()
{
  ConnectionTimeoutChecker = new System.Timers.Timer(1000);
  ConnectionTimeoutChecker.Elapsed += new System.Timers.ElapsedEventHandler(ConnectionTimeoutChecker_Elapsed);
}

void ConnectionTimeoutChecker_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{ //_DeviceConTimeout eventually reaches A LOT MORE than 10.
  if (_DeviceConTimeout &gt; 10)
  {
    ConnectionTimeoutChecker.Stop(); //This is invoked but the timer DOES NOT STOP.
    if (OnDeviceSyncTimeout != null) OnDeviceSyncTimeout(this, null); //This gets fired all the time.
  }
  _DeviceConTimeout++; //This keeps increasing and increasing.
  //Worth mentioning: sender = Timer, sender.Enabled = false (!) so then why is this executing?
}
</code></pre>

<p>As for where I start it: I start it in a single place, I put a breakpoint there and it doesn't execute more than once. And before you ask: no multiple threads are involved. I do work with threads in this application, but: the timer is not created in a thread, neither is the Class.</p>

<p>Yet the .Stop(); is executed 100 times and the timer still WON'T stop.</p>

<p>I'm completely at a loss here. This behavior is so strange to me, it gives me that embarrassed feeling that I might have been missing something super-obvious. Sometimes writing such a post helps me identify the problem before I hit the submit button (we all know the "Explaining to 3rd party" effect). But it didn't hit me yet so I'm gonna hit the button and... see what you see ::- D.</p>
