DeviceWatcher.Start DeviceWatcher.Start DeviceWatcher.Start DeviceWatcher.Start DeviceWatcher.Start Method

Definition

Starts a search for devices, and subscribes to device enumeration events.

public : void Start()
void Start() const;
public void Start()
Public Sub Start()
deviceWatcher.start();

Remarks

An app calls Start to begin the search for devices. During this initial enumeration, the DeviceWatcher raises an Added event for each device that's found, until all devices are found. The DeviceWatcher raises an EnumerationCompleted event when the initial enumeration is complete, and continues to raise events if a device is added, updated, or removed.

The Start method can only be called when the DeviceWatcher is in the Created, Stopped or Aborted state. The Status property indicates the DeviceWatcher state. When re-starting the watcher, wait for the Stopped event before calling Start. The following diagram shows how the DeviceWatcher transitions between the states represented by DeviceWatcherStatus enumeration.

state diagram of DeviceWatcher states