Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="action"></param>
        /// <param name="delay"></param>
        public virtual void InvokeImp(Action action, uint delay)
        {
            CancelInvokeImp(action);

            var param = TimerWrapper.New(Name, action, delay);

            _timers.Add(action, param);
            param.Start();
        }
Example #2
0
        /// <summary>
        ///     Internal invoker for Obj
        /// </summary>
        /// <param name="action"></param>
        /// <param name="delay"></param>
        public override void InvokeImp(Action action, uint delay)
        {
            CancelInvoke(action);

            var timer = TimerWrapper.New("", () =>
            {
                using (new Flusher(_flushable))
                {
                    CancelInvoke(action);
                    action();
                }
            }, delay);

            AddTimer(action, timer);
            timer.Start();
        }
Example #3
0
 /// <summary>
 ///     add action
 ///     used internal
 /// </summary>
 /// <param name="action"></param>
 /// <param name="aw"></param>
 protected void AddTimer(Action action, TimerWrapper aw) => _timers.Add(action, aw);