CreateWatcher(PnpObjectType, IIterable(String)) | createWatcher(PnpObjectType, IIterable(String)) method

PnpObject.CreateWatcher(PnpObjectType, IIterable(String)) | createWatcher(PnpObjectType, IIterable(String)) method

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

Syntax


var pnpObjectWatcher = Windows.Devices.Enumeration.Pnp.PnpObject.createWatcher(type, requestedProperties);

Parameters

type

Type: PnpObjectType

The type of the PnpObject.

requestedProperties

Type: IIterable<String> [JavaScript/C++] | System.Collections.Generic.IEnumerable<String> [.NET]

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.

Return value

Type: PnpObjectWatcher

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

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.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Devices.Enumeration.Pnp
Windows::Devices::Enumeration::Pnp [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Devices.Enumeration.Pnp
Windows::Devices::Enumeration::Pnp [C++]

Metadata

Windows.winmd

See also

PnpObject
CreateWatcher(PnpObjectType, IIterable_1, String)
Device information properties

 

 

Show:
© 2017 Microsoft