private void CreateAndStartTimer()
{
if (TimeOut.HasValue)
{
// If you have a really large value, do not set a timer.
if (TimeOut.Value.TotalSeconds > 1000) return;
}
else
{
TimeOut = new TimeSpan(0, 0, 0, 0, 1500);
}
toTimer = new Timer { Interval = TimeOut.Value.TotalMilliseconds };
toTimer.Elapsed += ToTimerTick;
toTimer.Start();
}