Share via


Battery.ReportUpdated 事件

定义

当电池的充电、容量或状态发生更改时发生。

// Register
event_token ReportUpdated(TypedEventHandler<Battery, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
Battery::ReportUpdated_revoker ReportUpdated(auto_revoke_t, TypedEventHandler<Battery, IInspectable const&> const& handler) const;
public event TypedEventHandler<Battery,object> ReportUpdated;
function onReportUpdated(eventArgs) { /* Your code */ }
battery.addEventListener("reportupdated", onReportUpdated);
battery.removeEventListener("reportupdated", onReportUpdated);
- or -
battery.onreportupdated = onReportUpdated;
Public Custom Event ReportUpdated As TypedEventHandler(Of Battery, Object) 

事件类型

注解

ReportUpdated 事件由连接到设备的任何电池的状态、充电速率或电源容量的任何更改触发。 这通常会在发生状态变化时立即发生,在发生所有其他变化时定期发生。

适用于

另请参阅