internal TimerQueueTimer( TimerQueue queue, TimerCallback cb, object state, uint dueTime, uint period, TimerQueueTimerFlags flags) { MyQueue = queue; Callback = cb; win32WaitOrTimerCallback = TimerCallback; UserState = state; bool rslt = TQTimerWin32.CreateTimerQueueTimer( out Handle, MyQueue.Handle, win32WaitOrTimerCallback, IntPtr.Zero, dueTime, period, flags); if (!rslt) { throw new Win32Exception(Marshal.GetLastWin32Error(), "Error creating timer."); } }
public extern static bool CreateTimerQueueTimer( out IntPtr newTimer, IntPtr timerQueue, Win32WaitOrTimerCallback callback, IntPtr userState, uint dueTime, uint period, TimerQueueTimerFlags flags);
public TimerQueueTimer CreateOneShot( TimerCallback callback, object state, uint dueTime, TimerQueueTimerFlags flags) { return(CreateTimer(callback, state, dueTime, 0, (flags | TimerQueueTimerFlags.ExecuteOnlyOnce))); }
public TimerQueueTimer CreateTimer( TimerCallback callback, object state, uint dueTime, uint period, TimerQueueTimerFlags flags) { return(new TimerQueueTimer(this, callback, state, dueTime, period, flags)); }
public TimerQueueTimer CreateOneShot( TimerCallback callback, object state, uint dueTime, TimerQueueTimerFlags flags) { return CreateTimer(callback, state, dueTime, 0, (flags | TimerQueueTimerFlags.ExecuteOnlyOnce)); }
public TimerQueueTimer CreateTimer( TimerCallback callback, object state, uint dueTime, uint period, TimerQueueTimerFlags flags) { return new TimerQueueTimer(this, callback, state, dueTime, period, flags); }