Пример #1
0
 internal void AddTimer(TimerCallback callback, object state, uint dueTime, uint period, ref StackCrawlMark stackMark)
 {
     if (callback == null)
     {
         throw new ArgumentNullException("TimerCallback");
     }
     _TimerCallback callback2 = new _TimerCallback(callback, state, ref stackMark);
     state = callback2;
     this.AddTimerNative(state, dueTime, period, ref stackMark);
     this.timerDeleted = 0;
 }
Пример #2
0
        internal void AddTimer(TimerCallback callback, object state, uint dueTime, uint period, ref StackCrawlMark stackMark)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("TimerCallback");
            }
            _TimerCallback callback2 = new _TimerCallback(callback, state, ref stackMark);

            state = callback2;
            this.AddTimerNative(state, dueTime, period, ref stackMark);
            this.timerDeleted = 0;
        }
Пример #3
0
        internal static void PerformTimerCallback(object state)
        {
            _TimerCallback callback = (_TimerCallback)state;

            if (callback._executionContext == null)
            {
                callback._timerCallback(callback._state);
            }
            else
            {
                ExecutionContext.Run(callback._executionContext.CreateCopy(), _ccb, callback);
            }
        }
Пример #4
0
        // call back helper
        static internal void PerformTimerCallback(Object state)
        {
            _TimerCallback helper = (_TimerCallback)state;

            BCLDebug.Assert(helper != null, "Null state passed to PerformTimerCallback!");
            // call directly if EC flow is suppressed
            if (helper._executionContext == null)
            {
                TimerCallback callback = helper._timerCallback;
                callback(helper._state);
            }
            else
            {
                // From this point on we can use useExecutionContext for this callback
                ExecutionContext.Run(helper._executionContext.CreateCopy(), _ccb, helper);
            }
        }
Пример #5
0
 internal void AddTimer(TimerCallback callback,
                        Object state,
                        UInt32 dueTime,
                        UInt32 period,
                        ref StackCrawlMark stackMark
                        )
 {
     if (callback != null)
     {
         _TimerCallback callbackHelper = new _TimerCallback(callback, state, ref stackMark);
         state = (Object)callbackHelper;
         AddTimerNative(state, dueTime, period, ref stackMark);
         timerDeleted = 0;
     }
     else
     {
         throw new ArgumentNullException("TimerCallback");
     }
 }
Пример #6
0
 internal void AddTimer(TimerCallback   callback,
                                    Object          state, 
                                    UInt32      dueTime,
                                    UInt32          period,
                                    ref StackCrawlMark  stackMark
                                    )
 {
     if (callback != null)
     {
         _TimerCallback callbackHelper = new _TimerCallback(callback, state, ref stackMark);
         state = (Object)callbackHelper;
         AddTimerNative(state, dueTime, period, ref stackMark);
         timerDeleted = 0;
     }
     else
     {
         throw new ArgumentNullException("TimerCallback");
     }
 }
        internal static void TimerCallback_Context(object state)
        {
            _TimerCallback callback = (_TimerCallback)state;

            callback._timerCallback(callback._state);
        }
Пример #8
0
        static internal void TimerCallback_Context(Object state)
        {
            _TimerCallback helper = (_TimerCallback)state;

            helper._timerCallback(helper._state);
        }