示例#1
0
 protected void Start(MediaTimerMode mode, int intervalMilliseconds)
 {
     CheckUp(intervalMilliseconds);
     if (mode == MediaTimerMode.OneShot)
     {
         _timerId = timeSetEvent(intervalMilliseconds, _caps.PeriodMin, _oneShotCallback, 0, (int)mode);
     }
     else
     {
         _timerId = timeSetEvent(intervalMilliseconds, _caps.PeriodMin, _periodicCallback, 0, (int)mode);
     }
     if (_timerId == 0)
     {
         throw new Exception(Strings.UnableStartMediaTimer);
     }
 }
示例#2
0
 public MediaTimer(MediaTimerMode mode, int intervalMilliseconds)
 {
     this.Mode = mode;
     this.IntervalMilliseconds = intervalMilliseconds;
 }