public MMTimer(SynchronizationContext synchronizationContext = null, bool executeOnUIThread = true) { callback_ = new MMTimerCallback(TimerCallback); if (synchronizationContext != null || executeOnUIThread) { if (synchronizationContext != null) { synchronizationContext_ = synchronizationContext; } else { synchronizationContext_ = SynchronizationContext.Current ?? MMTimerStatics.DefaultContext; } Debug.Assert(synchronizationContext_ != null); } invokeHandlers_ = new SendOrPostCallback(InvokeHandlers); }
private static extern uint timeSetEvent(uint uDelay, uint uResolution, MMTimerCallback lpTimeProc, UIntPtr dwUser, uint eventType);
public static extern UInt32 TimeSetEvent(UInt32 msDelay, UInt32 msResolution, MMTimerCallback callback, UIntPtr userCtx, MMTIMER_EVENT_TYPE eventType = MMTIMER_EVENT_TYPE.PERIODIC);