Exemple #1
0
        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);
        }
Exemple #2
0
 public LmTimerItem(int id, int delta, LmTimerType type)
 {
     Id        = id;
     Delta     = delta;
     TimerType = type;
 }
Exemple #3
0
			public LmTimerItem(int id, int delta, LmTimerType type)
			{
				Id = id;
				Delta = delta;
				TimerType = type;
			}
Exemple #4
0
		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;
		}