DeviceInformation.CreateWatcher
DeviceInformation.CreateWatcher
DeviceInformation.CreateWatcher
DeviceInformation.CreateWatcher
DeviceInformation.CreateWatcher
Method
Definition
Overloads
CreateWatcher() CreateWatcher() CreateWatcher() CreateWatcher() CreateWatcher()
Creates a DeviceWatcher for all devices.
public : static DeviceWatcher CreateWatcher()
static DeviceWatcher CreateWatcher() const;
public static DeviceWatcher CreateWatcher()
Public Shared Function CreateWatcher() As DeviceWatcher
var deviceWatcher = Windows.Devices.Enumeration.DeviceInformation.createWatcher();
Returns
The created DeviceWatcher.
Remarks
The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.
See the DeviceWatcher class for an example.
CreateWatcher(DeviceClass) CreateWatcher(DeviceClass) CreateWatcher(DeviceClass) CreateWatcher(DeviceClass) CreateWatcher(DeviceClass)
Creates a DeviceWatcher for devices matching the specified DeviceClass.
public : static DeviceWatcher CreateWatcher(DeviceClass deviceClass)
static DeviceWatcher CreateWatcher(DeviceClass deviceClass) const;
public static DeviceWatcher CreateWatcher(DeviceClass deviceClass)
Public Shared Function CreateWatcher(deviceClass As DeviceClass) As DeviceWatcher
var deviceWatcher = Windows.Devices.Enumeration.DeviceInformation.createWatcher(deviceClass);
Parameters
- deviceClass
- DeviceClass DeviceClass DeviceClass
The class of device to enumerate using the DeviceWatcher.
Returns
The created DeviceWatcher.
Remarks
The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.
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 the DeviceWatcher class for an example.
CreateWatcher(String) CreateWatcher(String) CreateWatcher(String) CreateWatcher(String) CreateWatcher(String)
Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string.
public : static DeviceWatcher CreateWatcher(Platform::String aqsFilter)
static DeviceWatcher CreateWatcher(winrt::hstring aqsFilter) const;
public static DeviceWatcher CreateWatcher(String aqsFilter)
Public Shared Function CreateWatcher(aqsFilter As String) As DeviceWatcher
var deviceWatcher = Windows.Devices.Enumeration.DeviceInformation.createWatcher(aqsFilter);
Parameters
- aqsFilter
- String String String
An AQS string that filters the DeviceInformation objects to enumerate. Typically this string is retrieved from the GetDeviceSelector method of a class that interacts with devices. For example, GetDeviceSelector retrieves the string for the StorageDevice class.
Returns
The created DeviceWatcher.
Remarks
Note
This overload is not available from JavaScript. To create a DeviceWatcher from an AQS string in JavaScript, use the CreateWatcher(String, IIterable_1) overload and pass null
as the second parameter.
The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.
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 the DeviceWatcher class for an example.
CreateWatcher(String, IIterable<String>) CreateWatcher(String, IIterable<String>) CreateWatcher(String, IIterable<String>) CreateWatcher(String, IIterable<String>) CreateWatcher(String, IIterable<String>)
Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string and the specified collection of properties.
public : static DeviceWatcher CreateWatcher(Platform::String aqsFilter, IIterable<Platform::String> additionalProperties)
static DeviceWatcher CreateWatcher(winrt::hstring aqsFilter, IIterable<winrt::hstring> additionalProperties) const;
public static DeviceWatcher CreateWatcher(String aqsFilter, IEnumerable<String> additionalProperties)
Public Shared Function CreateWatcher(aqsFilter As String, additionalProperties As IEnumerable(Of String)) As DeviceWatcher
var deviceWatcher = Windows.Devices.Enumeration.DeviceInformation.createWatcher(aqsFilter, additionalProperties);
Parameters
- aqsFilter
- String String String
An AQS string that filters the DeviceInformation objects to enumerate. Typically this string is retrieved from the GetDeviceSelector method of a class that interacts with devices. For example, GetDeviceSelector retrieves the string for the StorageDevice class.
- additionalProperties
- IEnumerable<String> IEnumerable<String> IEnumerable<String>
An iterable list of additional properties to include in the Properties property of the DeviceInformation objects in the enumeration results. For more info on what the properties represent, see Device information properties.
Returns
The created DeviceWatcher.
Remarks
The DeviceWatcher first performs an initial enumeration of devices, raising an Added event for each device that it finds, and raising an EnumerationCompleted event when the initial enumeration is complete. After the initial enumeration is complete, it raises events when a device is added, deleted, or updated.
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 the DeviceWatcher class for an example.
CreateWatcher(String, IIterable<String>, DeviceInformationKind) CreateWatcher(String, IIterable<String>, DeviceInformationKind) CreateWatcher(String, IIterable<String>, DeviceInformationKind) CreateWatcher(String, IIterable<String>, DeviceInformationKind) CreateWatcher(String, IIterable<String>, DeviceInformationKind)
Creates a DeviceWatcher for devices matching the specified Advanced Query Syntax (AQS) string, the specified collection of properties, and the kind of devices.
public : static DeviceWatcher CreateWatcher(Platform::String aqsFilter, IIterable<Platform::String> additionalProperties, DeviceInformationKind kind)
static DeviceWatcher CreateWatcher(winrt::hstring aqsFilter, IIterable<winrt::hstring> additionalProperties, DeviceInformationKind kind) const;
public static DeviceWatcher CreateWatcher(String aqsFilter, IEnumerable<String> additionalProperties, DeviceInformationKind kind)
Public Shared Function CreateWatcher(aqsFilter As String, additionalProperties As IEnumerable(Of String), kind As DeviceInformationKind) As DeviceWatcher
var deviceWatcher = Windows.Devices.Enumeration.DeviceInformation.createWatcher(aqsFilter, additionalProperties, kind);
Parameters
- aqsFilter
- String String String
An AQS string that filters the DeviceInformation objects to enumerate. Typically this string is retrieved from the GetDeviceSelector method of a class that interacts with devices. For example, GetDeviceSelector retrieves the string for the StorageDevice class.
- additionalProperties
- IEnumerable<String> IEnumerable<String> IEnumerable<String>
An iterable list of additional properties to include in the Properties property of the DeviceInformation objects in the enumeration results. For more info on what the properties represent, see Device information properties.
The specific types of devices the DeviceWatcher is interested in.
Returns
The created DeviceWatcher.
Feedback
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.
Loading feedback...