Exemplo n.º 1
0
        public TimedTimerEntry CallPeriodically(int interval, Action action)
        {
            TimedTimerEntry timedTimerEntry = new TimedTimerEntry
            {
                Interval = interval,
                Action   = action
            };

            timedTimerEntry.Start();
            this.RegisterTimerLater(timedTimerEntry);
            return(timedTimerEntry);
        }
Exemplo n.º 2
0
        public virtual void AddTimer(TimedTimerEntry timer)
        {
            ExecuteInContext(() =>
            {
                if (!timer.Enabled)
                {
                    timer.Start();
                }

                m_timers.Push(timer);
            });
        }
Exemplo n.º 3
0
Arquivo: Area.cs Projeto: Mixi59/Stump
        public TimedTimerEntry CallPeriodically(int interval, Action action)
        {
            var timer = new TimedTimerEntry
            {
                Interval = interval,
                Action   = action
            };

            timer.Start();
            RegisterTimer(timer);
            return(timer);
        }
Exemplo n.º 4
0
Arquivo: Area.cs Projeto: Mixi59/Stump
        public void RegisterTimer(TimedTimerEntry timer)
        {
            ExecuteInContext(() =>
            {
                if (!timer.Enabled)
                {
                    timer.Start();
                }

                m_timers.Push(timer);
            });
        }
Exemplo n.º 5
0
        public void Start()
        {
            if (Running)
            {
                return;
            }

            Running = true;
            TaskPool.Start();

            m_updateTimer.Start();
            TaskPool.AddTimer(m_updateTimer);
        }
Exemplo n.º 6
0
        public TimedTimerEntry CallDelayed(int delay, Action action)
        {
            TimedTimerEntry timedTimerEntry = new TimedTimerEntry
            {
                Interval = -1,
                Delay    = delay,
                Action   = action
            };

            timedTimerEntry.Start();
            this.RegisterTimerLater(timedTimerEntry);
            return(timedTimerEntry);
        }
Exemplo n.º 7
0
Arquivo: Area.cs Projeto: Mixi59/Stump
        public TimedTimerEntry CallDelayed(int delay, Action action)
        {
            var timer = new TimedTimerEntry
            {
                Interval = -1,
                Delay    = delay,
                Action   = action
            };

            timer.Start();
            RegisterTimer(timer);
            return(timer);
        }