Code: Select all
private async void DigitalInput_StateChange(object sender, Phidget22.Events.DigitalInputStateChangeEventArgs e)
{
try
{
if (isInitialised)
{
await DigitalInputStatus((DigitalInput)sender, e.State);
}
}
catch (PhidgetException ex)
{
Debug.WriteLine("[ERROR] StateChanged.PhEx " + ex.ErrorCode + " (" + ex.Description + "): " + ex.Detail);
}
}
Is there any coding pattern or example for this scenario. i.e. running long running tasks from a phidget event?