private void ConsoleReportReceived(HidConsoleDevice device, string report) { if (!InvokeRequired) { int selectedDevice = consoleList.SelectedIndex; if (selectedDevice == 0 || consoleListener.Devices[selectedDevice - 1] == device) { if (lastReportedDevice != device) { _printer.Print($"{device.ManufacturerString} {device.ProductString}:", MessageType.Hid); lastReportedDevice = device; } _printer.PrintResponse(report, MessageType.Hid); } } else { Invoke(new Action <HidConsoleDevice, string>(ConsoleReportReceived), device, report); } }
private void ConsoleDeviceDisconnected(HidConsoleDevice device) { lastReportedDevice = null; UpdateConsoleList(); _printer.Print($"HID console disconnected: {device}", MessageType.Hid); }