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

            threadContext.Cancel().Wait();
            started = false;
        }
コード例 #5
0
 public void Stop()
 {
     if (Running)
     {
         readThreadContext.Cancel().Wait();
         if (InputConfiguration.Autostart)
         {
             InputConfiguration.Autostart = false;
             inputConfigManager.SaveConfig(this);
         }
     }
 }
コード例 #6
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposed)
     {
         return;
     }
     if (disposing)
     {
         readThreadContext?.Cancel()?.Wait();
     }
     disposed = true;
 }
コード例 #7
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposed)
     {
         return;
     }
     if (disposing)
     {
         forceFeedbackThreadContext.Cancel().Wait();
         readThreadContext.Cancel().Wait();
         joystick.Dispose();
     }
     disposed = true;
 }
コード例 #8
0
ファイル: GameController.cs プロジェクト: yy520a/XOutput
 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();
         }
     }
 }
コード例 #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;
 }
コード例 #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();
         }
     }
 }
コード例 #11
0
ファイル: WebXOutputDevice.cs プロジェクト: varshith/XOutput
 public void Dispose()
 {
     inputRefresher?.Cancel().Wait();
 }
コード例 #12
0
 public virtual void Close()
 {
     pingThreadContext.Cancel();
 }
コード例 #13
0
 public override void Close()
 {
     base.Close();
     threadContext.Cancel();
 }
コード例 #14
0
 public void Close()
 {
     device.InputChanged -= InputChanged;
     threadContext.Cancel().Wait();
 }