Exemplo n.º 1
0
 public void StopNamedPipe()
 {
     if (notifyThreadContext != null)
     {
         notifyThreadContext.Cancel().Wait();
     }
 }
Exemplo n.º 2
0
 public void Close()
 {
     foreach (var inputDevice in device.GetInputDevices())
     {
         inputDevice.InputChanged -= InputChanged;
     }
     threadContext.Cancel().Wait();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Disposes all resources.
 /// </summary>
 public void Dispose()
 {
     if (!disposed)
     {
         disposed = true;
         inputRefresher?.Cancel().Wait();
         Disconnected?.Invoke(this, new DeviceDisconnectedEventArgs());
     }
 }
Exemplo n.º 4
0
        public async Task CloseAsync(CancellationToken token = default)
        {
            if (!started)
            {
                return;
            }
            await client.CloseAsync(WebSocketCloseStatus.NormalClosure, null, token);

            threadContext.Cancel().Wait();
            started = false;
        }
Exemplo n.º 5
0
 public void Stop()
 {
     if (Running)
     {
         readThreadContext.Cancel().Wait();
         if (InputConfiguration.Autostart)
         {
             InputConfiguration.Autostart = false;
             inputConfigManager.SaveConfig(this);
         }
     }
 }
Exemplo n.º 6
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposed)
     {
         return;
     }
     if (disposing)
     {
         readThreadContext?.Cancel()?.Wait();
     }
     disposed = true;
 }
Exemplo n.º 7
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposed)
     {
         return;
     }
     if (disposing)
     {
         forceFeedbackThreadContext.Cancel().Wait();
         readThreadContext.Cancel().Wait();
         joystick.Dispose();
     }
     disposed = true;
 }
Exemplo n.º 8
0
 public void Stop()
 {
     if (running)
     {
         running              = false;
         XInput.InputChanged -= XInputInputChanged;
         client.Feedback     -= FeedbackReceived;
         logger.Info($"Force feedback mapping is disconnected on {ToString()}.");
         xOutputManager.Stop(client);
         logger.Info($"Emulation stopped on {ToString()}.");
         if (threadContext != null)
         {
             threadContext.Cancel().Wait();
         }
     }
 }
Exemplo n.º 9
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposed)
     {
         return;
     }
     if (disposing)
     {
         foreach (var inputDeviceProvider in inputDeviceProviders)
         {
             inputDeviceProvider.Connected    -= Connected;
             inputDeviceProvider.Disconnected -= Disconnected;
         }
         readThreadContext?.Cancel()?.Wait();
     }
     disposed = true;
 }
Exemplo n.º 10
0
 /// <summary>
 /// Stops the emulation of the device
 /// </summary>
 public void Stop()
 {
     if (running)
     {
         running              = false;
         XInput.InputChanged -= XInputInputChanged;
         if (ForceFeedbackSupported)
         {
             controller.FeedbackReceived -= ControllerFeedbackReceived;
             logger.Info($"Force feedback mapping is disconnected on {ToString()}.");
         }
         xOutputManager.Stop(controllerCount);
         controllerCount = 0;
         logger.Info($"Emulation stopped on {ToString()}.");
         if (threadContext != null)
         {
             threadContext.Cancel().Wait();
         }
     }
 }
Exemplo n.º 11
0
 public void Dispose()
 {
     inputRefresher?.Cancel().Wait();
 }
Exemplo n.º 12
0
 public virtual void Close()
 {
     pingThreadContext.Cancel();
 }
 public override void Close()
 {
     base.Close();
     threadContext.Cancel();
 }
Exemplo n.º 14
0
 public void Close()
 {
     device.InputChanged -= InputChanged;
     threadContext.Cancel().Wait();
 }