public int AddTimer(int delta, LmTimerType timerType) { LmTimerItem timer = null; lock (_TimerLock) { int timerId = m_nTimerIdCtr++; timer = new LmTimerItem(timerId, delta, timerType); //if (_Items.ContainsID(timerId)) //{ //} _Items.Add(timer); // start timer manager if (_IsAutoStart && _IsRunning == false) { Start(); } } // reinit timer RestartTimer(timer.Id); return(timer.Id); }
public LmTimerItem(int id, int delta, LmTimerType type) { Id = id; Delta = delta; TimerType = type; }
public int AddTimer(int delta, LmTimerType timerType) { LmTimerItem timer = null; lock (_TimerLock) { int timerId = m_nTimerIdCtr++; timer = new LmTimerItem(timerId, delta, timerType); //if (_Items.ContainsID(timerId)) //{ //} _Items.Add(timer); // start timer manager if (_IsAutoStart && _IsRunning == false) { Start(); } } // reinit timer RestartTimer(timer.Id); return timer.Id; }