public TimerLogic()
{
m_timer = new Timer();
m_timer.Interval = m_tick;
m_timer.Tick += delegate
{
m_log.Debug("Tick event happened");
m_timer.Stop();
// Commented until find bugs
// if(MousePositionHelper.MouseNotMoving == false)
// {
List<Task> tasksToShow = new DbHelper().LoadTasksForShowing();
m_log.DebugFormat("Loaded {0} tasks for showing", tasksToShow.Count);
foreach (Task task in tasksToShow)
{
new TaskShowController(task).PrepareWindow(); //Įkėliau viską į preparerį.
m_log.DebugFormat("Showed task with id {0}, name {1}, showTime {2}",
task.Id, task.Text, DBTypesConverter.ToFullDateStringByCultureInfo(task.DateRemainder));
}
// }
SetNewTimerInterval();
m_timer.Start();
};
m_timer.Start();
}