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