Exemplo n.º 1
0
 public void Stop()
 {
     lock (timerLock)
     {
         if (_timer == null)
         {
             return;
         }
         _timer.Stop();
         _timer.Dispose();
         _timer = null;
     }
 }
Exemplo n.º 2
0
 public void Stop()
 {
     lock (timerLock)
     {
         if (_timer == null)
         {
             return;
         }
         _timer.Stop();
         _timer.Dispose();
         _timer            = null;
         _AllowThreadToRun = false;
         _ResetEvent.Set();
     }
 }
Exemplo n.º 3
0
        void TimerProcess()
        {
            // Create device form.
            deviceForm                 = new System.Windows.Forms.Form();
            deviceForm.Text            = "X360CE Force Feedback Form";
            deviceForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            deviceForm.MinimizeBox     = false;
            deviceForm.MaximizeBox     = false;
            deviceForm.ShowInTaskbar   = false;
            // Force to create handle.
            var handle = deviceForm.Handle;

            // Set timer.
            _timer.Interval = (int)Frequency;
            _timer.Start();
            // Wait here until all items returns to the pool.
            TimerSemaphore.Wait();
            _timer.Stop();
            // Dispose form on the same thread as it was created.
            deviceForm.Dispose();
        }
Exemplo n.º 4
0
 public void Stop()
 {
     _timer.Stop();
 }