PnpObjectWatcher.Updated 事件

定义

重要

我们不再建议使用 Windows.Devices.Enumeration.Pnp 命名空间中的类型。 相反,Windows.Devices.Enumeration 命名空间中的类型实现了 Windows.Devices.Enumeration.Pnp 功能的新式且维护得更好的超集。

PnpObjectType 的替代方法是 Windows.Devices.Enumeration.DeviceInformationKind 枚举,你可以将其作为参数传递给 Windows.Devices.Enumeration API。 例如,创建 PnpObjectWatcher 时不使用 PnpObjectType,而是在创建 DeviceWatcher 时使用 DeviceInformationKind

更新 PnpObjectWatcher 枚举的集合中 PnpObject 的属性时发生。

// Register
event_token Updated(TypedEventHandler<PnpObjectWatcher, PnpObjectUpdate const&> const& handler) const;

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

// Revoke with event_revoker
PnpObjectWatcher::Updated_revoker Updated(auto_revoke_t, TypedEventHandler<PnpObjectWatcher, PnpObjectUpdate const&> const& handler) const;
public event TypedEventHandler<PnpObjectWatcher,PnpObjectUpdate> Updated;
function onUpdated(eventArgs) { /* Your code */ }
pnpObjectWatcher.addEventListener("updated", onUpdated);
pnpObjectWatcher.removeEventListener("updated", onUpdated);
- or -
pnpObjectWatcher.onupdated = onUpdated;
Public Custom Event Updated As TypedEventHandler(Of PnpObjectWatcher, PnpObjectUpdate) 

事件类型

适用于