mono/mono — pull request #1213 by fengari (2014-08-18 10:22:29+00:00)
Title: System.Timers.Timer optimization and small correction

Do not dispose the underlying System.Threading.Timer every time Enabled is set to false, keep it around for as long as this Timer exists.

This class is often used with a pattern where the Timer is disabled at the start of the Elapsed event and re-enabled at the end. This is used to protect against re-entrance.

timer.Elapsed += () =>
{
timer.Enabled = false;
.... do work ....
timer.Enabled = true;
}

Thus, it can be disabled and enabled a lot.

Throw ObjectDisposedException on Enabled setter, MSDN says this should happen. Seems to be the only one that throws this, based on MS docs.