Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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

Applies to Windows and Windows Phone

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 the list of properties in How to retrieve additional properties for a device or PnP object.

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

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)
How to retrieve additional properties for a device or PnP object

 

 

Show:
© 2014 Microsoft