Exemplo n.º 1
0
 private static extern uint timeSetEvent(
     uint uDelay,
     uint uResolution,
     LpTimeProcDelegate lpTimeProc,
     int dwUser,
     TimerMode fuEvent
     );
Exemplo n.º 2
0
        public MultimediaTimer(Action <object> callback, object state, int period)
        {
            if (period <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(period), "Period must be greater than 0");
            }

            _callback = callback;
            _state    = state;

            _lpTimeProc = CallbackInternal;
            _eventId    = timeSetEvent((uint)period, 1, _lpTimeProc, 0, TimerMode.Periodic);
        }
Exemplo n.º 3
0
 public void Dispose()
 {
     _lpTimeProc = default;
     timeKillEvent(_eventId);
 }