예제 #1
0
        /// <summary>
        /// Adds scheduled action to list.
        /// </summary>
        /// <param name="action"></param>
        /// <param name="firstInMs"></param>
        /// <param name="regularInMs"></param>
        /// <returns></returns>
        public IDisposable ScheduleOnInterval(Action action, long firstInMs, long regularInMs)
        {
            StubScheduledAction toAdd = new StubScheduledAction(action, firstInMs, regularInMs, this._scheduled);

            this._scheduled.Add(toAdd);
            return(toAdd);
        }
예제 #2
0
        /// <summary>
        /// Adds a scheduled action to the list.
        /// </summary>
        /// <param name="action"></param>
        /// <param name="firstInMs"></param>
        /// <returns></returns>
        public IDisposable Schedule(Action action, long firstInMs)
        {
            StubScheduledAction toAdd = new StubScheduledAction(action, firstInMs, this._scheduled);

            this._scheduled.Add(toAdd);
            return(toAdd);
        }
예제 #3
0
 /// <summary>
 /// Execute all actions in the scheduled list.
 /// </summary>
 public void ExecuteAllScheduled()
 {
     StubScheduledAction[] array = this._scheduled.ToArray();
     for (int i = 0; i < array.Length; i++)
     {
         StubScheduledAction scheduled = array[i];
         scheduled.Execute();
     }
 }