DeviceWatcher.Added DeviceWatcher.Added DeviceWatcher.Added DeviceWatcher.Added DeviceWatcher.Added Event

Definition

Event that is raised when a device is added to the collection enumerated by the DeviceWatcher.

public : event TypedEventHandler<DeviceWatcher, DeviceInformation> Added
// Register
event_token Added(TypedEventHandler<DeviceWatcher, DeviceInformation> const& handler) const;

// Revoke with event_token
void Added(event_token const& cookie) const;

// Revoke with event_revoker
Added_revoker Added(auto_revoke_t, TypedEventHandler<DeviceWatcher, DeviceInformation> const& handler) const;
public event TypedEventHandler<DeviceWatcher, DeviceInformation> Added
Public Event Added As TypedEventHandler (Of DeviceWatcher, DeviceInformation)
function onAdded(eventArgs){/* Your code */}


deviceWatcher.addEventListener("added", onAdded);
deviceWatcher.removeEventListener("added", onAdded);

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.

See also