Share via


PnpObject.CreateWatcher Method

Definition

Overloads

CreateWatcher(PnpObjectType, IIterable<String>)

Important

We no longer recommend that you use the types in the Windows.Devices.Enumeration.Pnp namespace. Instead, the types in the Windows.Devices.Enumeration namespace implement a modern, and better maintained, superset of the functionality of Windows.Devices.Enumeration.Pnp.

The alternative to PnpObjectType is the Windows.Devices.Enumeration.DeviceInformationKind enum, which you can pass as a parameter to Windows.Devices.Enumeration APIs. For example, instead of using PnpObjectType when you create a PnpObjectWatcher, use DeviceInformationKind when you create a DeviceWatcher.

Returns a PnpObjectWatcher object that is used to enumerate the PnP objects in the collection using events.

CreateWatcher(PnpObjectType, IIterable<String>, String)

Important

We no longer recommend that you use the types in the Windows.Devices.Enumeration.Pnp namespace. Instead, the types in the Windows.Devices.Enumeration namespace implement a modern, and better maintained, superset of the functionality of Windows.Devices.Enumeration.Pnp.

The alternative to PnpObjectType is the Windows.Devices.Enumeration.DeviceInformationKind enum, which you can pass as a parameter to Windows.Devices.Enumeration APIs. For example, instead of using PnpObjectType when you create a PnpObjectWatcher, use DeviceInformationKind when you create a DeviceWatcher.

Returns a PnpObjectWatcher object that is used to enumerate a filtered collection of PnP objects using events.

CreateWatcher(PnpObjectType, IIterable<String>)

Important

We no longer recommend that you use the types in the Windows.Devices.Enumeration.Pnp namespace. Instead, the types in the Windows.Devices.Enumeration namespace implement a modern, and better maintained, superset of the functionality of Windows.Devices.Enumeration.Pnp.

The alternative to PnpObjectType is the Windows.Devices.Enumeration.DeviceInformationKind enum, which you can pass as a parameter to Windows.Devices.Enumeration APIs. For example, instead of using PnpObjectType when you create a PnpObjectWatcher, use DeviceInformationKind when you create a DeviceWatcher.

Returns a PnpObjectWatcher object that is used to enumerate the PnP objects in the collection using events.

public:
 static PnpObjectWatcher ^ CreateWatcher(PnpObjectType type, IIterable<Platform::String ^> ^ requestedProperties);
/// [Windows.Foundation.Metadata.Overload("CreateWatcher")]
 static PnpObjectWatcher CreateWatcher(PnpObjectType const& type, IIterable<winrt::hstring> const& requestedProperties);
[Windows.Foundation.Metadata.Overload("CreateWatcher")]
public static PnpObjectWatcher CreateWatcher(PnpObjectType type, IEnumerable<string> requestedProperties);
function createWatcher(type, requestedProperties)
Public Shared Function CreateWatcher (type As PnpObjectType, requestedProperties As IEnumerable(Of String)) As PnpObjectWatcher

Parameters

type
PnpObjectType

The type of the PnpObject.

requestedProperties

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

An iterable list of additional properties to include in the Properties property of the PnpObject objects included in enumeration results. For more info on what the properties represent, see Device information properties.

Returns

A PnpObjectWatcher object used to enumerate the collection by registering event notification delegates and by issuing start and stop event notifications.

Attributes

Remarks

CreateWatcher is a primary starting point method for enumerating device objects. A client should use this API to enumerate PnpObjects if they want the enumeration to happen incrementally, or if they want the results to be updated as things change. For example, if a PnpObject is added, removed or its properties are updated, the client will register event handlers with the returned watcher object to receive the enumerated PnpObject as well as the later updates.

See also

Applies to

CreateWatcher(PnpObjectType, IIterable<String>, String)

Important

We no longer recommend that you use the types in the Windows.Devices.Enumeration.Pnp namespace. Instead, the types in the Windows.Devices.Enumeration namespace implement a modern, and better maintained, superset of the functionality of Windows.Devices.Enumeration.Pnp.

The alternative to PnpObjectType is the Windows.Devices.Enumeration.DeviceInformationKind enum, which you can pass as a parameter to Windows.Devices.Enumeration APIs. For example, instead of using PnpObjectType when you create a PnpObjectWatcher, use DeviceInformationKind when you create a DeviceWatcher.

Returns a PnpObjectWatcher object that is used to enumerate a filtered collection of PnP objects using events.

public:
 static PnpObjectWatcher ^ CreateWatcher(PnpObjectType type, IIterable<Platform::String ^> ^ requestedProperties, Platform::String ^ aqsFilter);
/// [Windows.Foundation.Metadata.Overload("CreateWatcherAqsFilter")]
 static PnpObjectWatcher CreateWatcher(PnpObjectType const& type, IIterable<winrt::hstring> const& requestedProperties, winrt::hstring const& aqsFilter);
[Windows.Foundation.Metadata.Overload("CreateWatcherAqsFilter")]
public static PnpObjectWatcher CreateWatcher(PnpObjectType type, IEnumerable<string> requestedProperties, string aqsFilter);
function createWatcher(type, requestedProperties, aqsFilter)
Public Shared Function CreateWatcher (type As PnpObjectType, requestedProperties As IEnumerable(Of String), aqsFilter As String) As PnpObjectWatcher

Parameters

type
PnpObjectType

The type of the PnpObject.

requestedProperties

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

An iterable list of additional properties to include in the Properties property of the PnpObject objects included in enumeration results. For more info on what the properties represent, see Device information properties.

aqsFilter
String

Platform::String

winrt::hstring

An AQS string that filters the PnP objects that will be returned. Typically, this string is retrieved from the method of a class that interacts with devices.

Returns

A PnpObjectWatcher object used to enumerate the collection by registering event notification delegates and by issuing start and stop event notifications.

Attributes

See also

Applies to