Pnp​Object Pnp​Object Pnp​Object Class

Definition

Represents a PnP object. This class allows access to well-known properties of a PnP object as well as a property store of additional properties that are specified to be retrieved from the the PnP object.

public sealed class PnpObject : IPnpObjectpublic sealed class PnpObject : IPnpObjectPublic NotInheritable Class PnpObject Implements IPnpObject
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

Id Id Id

A string representing the identity of the PnpObject.

public string Id { get; }public string Id { get; }Public ReadOnly Property Id As string
Value
string string string

The identity string.

Attributes

Properties Properties Properties

A property store containing well-known values as well as additional specified properties.

public IMapView<string, object> Properties { get; }public IMapView<string, object> Properties { get; }Public ReadOnly Property Properties As IMapView<string, object>
Value

A pointer to the property store.

Attributes

Remarks

For more info on what the properties represent, see Device information properties.

Type Type Type

The type of the PnpObject.

public PnpObjectType Type { get; }public PnpObjectType Type { get; }Public ReadOnly Property Type As PnpObjectType
Value
PnpObjectType PnpObjectType PnpObjectType

The type of the object.

Attributes

Methods

CreateFromIdAsync(PnpObjectType, String, IIterable<String>) CreateFromIdAsync(PnpObjectType, String, IIterable<String>) CreateFromIdAsync(PnpObjectType, String, IIterable<String>)

Creates a PnpObject object asynchronously from a previously saved DeviceInformation ID.

public static IAsyncOperation<PnpObject> CreateFromIdAsync(PnpObjectType type, String id, IIterable<String> requestedProperties)public static IAsyncOperation<PnpObject> CreateFromIdAsync(PnpObjectType type, String id, IIterable<String> requestedProperties)Public Static Function CreateFromIdAsync(type As PnpObjectType, id As String, requestedProperties As IIterable<String>) As IAsyncOperation( Of PnpObject )
Parameters
id
System.String System.String System.String

The string value identifying the PnpObject.

requestedProperties

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

Returns

The PnpObject created from the previously saved DeviceInformation ID.

Attributes

CreateWatcher(PnpObjectType, IIterable<String>) CreateWatcher(PnpObjectType, IIterable<String>) CreateWatcher(PnpObjectType, IIterable<String>)

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

public static PnpObjectWatcher CreateWatcher(PnpObjectType type, IIterable<String> requestedProperties)public static PnpObjectWatcher CreateWatcher(PnpObjectType type, IIterable<String> requestedProperties)Public Static Function CreateWatcher(type As PnpObjectType, requestedProperties As IIterable<String>) As PnpObjectWatcher
Parameters
requestedProperties

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 PnpObject s 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.

CreateWatcher(PnpObjectType, IIterable<String>, String) CreateWatcher(PnpObjectType, IIterable<String>, String) CreateWatcher(PnpObjectType, IIterable<String>, String)

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

public static PnpObjectWatcher CreateWatcher(PnpObjectType type, IIterable<String> requestedProperties, String aqsFilter)public static PnpObjectWatcher CreateWatcher(PnpObjectType type, IIterable<String> requestedProperties, String aqsFilter)Public Static Function CreateWatcher(type As PnpObjectType, requestedProperties As IIterable<String>, aqsFilter As String) As PnpObjectWatcher
Parameters
requestedProperties

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
System.String System.String System.String

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

FindAllAsync(PnpObjectType, IIterable<String>) FindAllAsync(PnpObjectType, IIterable<String>) FindAllAsync(PnpObjectType, IIterable<String>)

Returns all of the PnP objects of a specified type that match the specified criteria.

public static IAsyncOperation<PnpObjectCollection> FindAllAsync(PnpObjectType type, IIterable<String> requestedProperties)public static IAsyncOperation<PnpObjectCollection> FindAllAsync(PnpObjectType type, IIterable<String> requestedProperties)Public Static Function FindAllAsync(type As PnpObjectType, requestedProperties As IIterable<String>) As IAsyncOperation( Of PnpObjectCollection )
Parameters
requestedProperties

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

An object that represents the asynchronous operation.

Attributes

FindAllAsync(PnpObjectType, IIterable<String>, String) FindAllAsync(PnpObjectType, IIterable<String>, String) FindAllAsync(PnpObjectType, IIterable<String>, String)

Returns all of the PnP objects of a specified type that match the specified filter.

public static IAsyncOperation<PnpObjectCollection> FindAllAsync(PnpObjectType type, IIterable<String> requestedProperties, String aqsFilter)public static IAsyncOperation<PnpObjectCollection> FindAllAsync(PnpObjectType type, IIterable<String> requestedProperties, String aqsFilter)Public Static Function FindAllAsync(type As PnpObjectType, requestedProperties As IIterable<String>, aqsFilter As String) As IAsyncOperation( Of PnpObjectCollection )
Parameters
requestedProperties

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
System.String System.String System.String

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

An object that represents the asynchronous operation.

Attributes

Update(PnpObjectUpdate) Update(PnpObjectUpdate) Update(PnpObjectUpdate)

Updates the properties of an existing PnpObject by applying the changes described in a PnpObjectUpdate object.

public void Update(PnpObjectUpdate updateInfo)public void Update(PnpObjectUpdate updateInfo)Public Function Update(updateInfo As PnpObjectUpdate) As void
Parameters
updateInfo
PnpObjectUpdate PnpObjectUpdate PnpObjectUpdate

Indicates the properties to update.

Attributes