PnpObjectWatcher.Removed 事件

定义

重要

我们不再建议使用 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 Removed(TypedEventHandler<PnpObjectWatcher, PnpObjectUpdate const&> const& handler) const;

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

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

事件类型

适用于