private void StatusChangeMonitor(object source, FootpedalEventArgs statuschange) { FootpedalStatus newStatus = statuschange.Status; if (newStatus.IsLeftDown != _status.IsLeftDown) { } }
private async void DevicePoller_DeviceInitialized(object sender, DeviceEventArgs e) { _rs28Device = (IHidDevice)e.Device; try { while (true) { FootpedalStatus status = await ReadStatusAsync(); StatusChanged?.Invoke(this, new FootpedalEventArgs(status)); } } catch (Exception) { /* Probably due to device being uplugged */ } }
public FootpedalEventArgs(FootpedalStatus status) { Status = status; }