CustomSensor.ReadingChanged 事件

定义

每次传感器报告新的传感器读数时发生。

// Register
event_token ReadingChanged(TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs const&> const& handler) const;

// Revoke with event_token
void ReadingChanged(event_token const* cookie) const;

// Revoke with event_revoker
CustomSensor::ReadingChanged_revoker ReadingChanged(auto_revoke_t, TypedEventHandler<CustomSensor, CustomSensorReadingChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<CustomSensor,CustomSensorReadingChangedEventArgs> ReadingChanged;
function onReadingChanged(eventArgs) { /* Your code */ }
customSensor.addEventListener("readingchanged", onReadingChanged);
customSensor.removeEventListener("readingchanged", onReadingChanged);
- or -
customSensor.onreadingchanged = onReadingChanged;
Public Custom Event ReadingChanged As TypedEventHandler(Of CustomSensor, CustomSensorReadingChangedEventArgs) 

事件类型

注解

应用可以注册此事件处理程序以获取传感器读数。 应用必须建立所需的 ReportInterval。 这会通知传感器驱动程序分配资源以满足应用的要求。

适用于