public void Close() { foreach (var inputDevice in device.GetInputDevices()) { inputDevice.InputChanged -= InputChanged; } threadContext.Cancel().Wait(); }
public InputValuesMessageHandler(InputDeviceHolder device, SenderFunction <InputValuesMessage> senderFunction) { this.device = device; this.senderFunction = senderFunction; devices = device.GetInputDevices(); foreach (var inputDevice in devices) { inputDevice.InputChanged += InputChanged; } threadContext = ThreadCreator.CreateLoop($"Websocket input value writer {device.DisplayName}", ResponseLoop, 33).Start(); }