Dela via


DeviceWatcher.Removed Event

Definition

Event that is raised when a device is removed from the collection of enumerated devices.

// Register
event_token Removed(TypedEventHandler<DeviceWatcher, DeviceInformationUpdate const&> const& handler) const;

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

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

Event Type

Remarks

Note

An app must subscribe to all of the added, removed, and updated events to be notified when there are device additions, removals or updates. If an app handles only the added event, it will not receive an update if a device is added to the system after the initial device enumeration completes.

Applies to

See also