예제 #1
0
 void TimerProcess()
 {
     _timer          = new JocysCom.ClassLibrary.HiResTimer();
     _timer.Interval = (int)Frequency;
     _timer.Elapsed += Timer_Elapsed;
     _timer.Start();
     // Wait here until all items returns to the pool.
     TimerSemaphore.Wait();
     _timer.Dispose();
 }
예제 #2
0
 public override void Stop()
 {
     lock (monitorLock)
     {
         // If server is running then...
         if (_Timer != null)
         {
             _Timer.Dispose();
             _Timer = null;
         }
         _IsRunning = false;
     }
 }
예제 #3
0
 public void Stop()
 {
     lock (timerLock)
     {
         if (_timer == null)
         {
             return;
         }
         _timer.Stop();
         _timer.Dispose();
         _timer = null;
     }
 }
예제 #4
0
 public void Start()
 {
     lock (timerLock)
     {
         if (_timer != null)
         {
             return;
         }
         _timer          = new JocysCom.ClassLibrary.HiResTimer(2, "MainWindowTimer");
         _timer.Elapsed += Timer_Elapsed;
         _timer.Start();
     }
 }
예제 #5
0
 public void Start()
 {
     lock (timerLock)
     {
         if (_timer != null)
         {
             return;
         }
         _timer          = new JocysCom.ClassLibrary.HiResTimer();
         _timer.Elapsed += Timer_Elapsed;
         _timer.Interval = 2;
         _timer.Start();
     }
 }
예제 #6
0
 public void Start()
 {
     lock (timerLock)
     {
         if (_timer != null)
         {
             return;
         }
         watch.Restart();
         _timer          = new JocysCom.ClassLibrary.HiResTimer();
         _timer.Elapsed += Timer_Elapsed;
         _timer.Interval = (int)Frequency;
         _timer.Start();
     }
 }
예제 #7
0
 public void Stop()
 {
     lock (timerLock)
     {
         if (_timer == null)
         {
             return;
         }
         _timer.Stop();
         _timer.Dispose();
         _timer            = null;
         _AllowThreadToRun = false;
         _ResetEvent.Set();
     }
 }
예제 #8
0
 public void Start()
 {
     lock (timerLock)
     {
         if (_timer != null)
         {
             return;
         }
         watch.Restart();
         _timer          = new JocysCom.ClassLibrary.HiResTimer((int)Frequency, "DInputHelperTimer");
         _timer.Elapsed += Timer_Elapsed;
         _timer.Start();
         _AllowThreadToRun = true;
         RefreshAllAsync();
     }
 }
예제 #9
0
 public DInputHelper()
 {
     _timer              = new JocysCom.ClassLibrary.HiResTimer();
     _timer.Elapsed     += Timer_Elapsed;
     CombinedXiConencted = new bool[4];
     CombinedXiStates    = new State[4];
     LiveXiControllers   = new Controller[4];
     LiveXiConnected     = new bool[4];
     LiveXiStates        = new State[4];
     for (int i = 0; i < 4; i++)
     {
         CombinedXiStates[i]  = new State();
         LiveXiControllers[i] = new Controller((UserIndex)i);
         LiveXiStates[i]      = new State();
     }
     watch = new System.Diagnostics.Stopwatch();
 }
예제 #10
0
 public DInputHelper()
 {
     _timer          = new JocysCom.ClassLibrary.HiResTimer();
     _timer.Elapsed += Timer_Elapsed;
     TimerSemaphore  = new SemaphoreSlim(0);
     Manager         = new DirectInput();
     InitDeviceDetector();
     CombinedXiConencted = new bool[4];
     CombinedXiStates    = new State[4];
     LiveXiControllers   = new Controller[4];
     LiveXiConnected     = new bool[4];
     LiveXiStates        = new State[4];
     for (int i = 0; i < 4; i++)
     {
         CombinedXiStates[i]  = new State();
         LiveXiControllers[i] = new Controller((UserIndex)i);
         LiveXiStates[i]      = new State();
     }
     watch = new System.Diagnostics.Stopwatch();
 }
예제 #11
0
 public override void Start()
 {
     lock (monitorLock)
     {
         if (IsDisposing)
         {
             return;
         }
         if (_Timer != null)
         {
             // Server is already running;
             return;
         }
         _Timer          = new JocysCom.ClassLibrary.HiResTimer();
         _Timer.Interval = ScanInterval;
         //_Timer.AutoReset = false;
         _Timer.Elapsed += _Timer_Elapsed;
         _Timer.Start();
         _IsRunning = true;
     }
 }