PnpObject PnpObject PnpObject PnpObject Class

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.

Syntax

Declaration

public sealed class PnpObjectpublic sealed class PnpObjectPublic NotInheritable Class PnpObject

Properties summary

A string representing the identity of the PnpObject.

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

The type of the PnpObject.

Methods summary

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

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

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

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

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

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

Properties

  • Id
    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

    Property Value

    • string
      string
      string
      string

      The identity string.

  • Properties
    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>

    Property Value

    • A pointer to the property store.

    Remarks

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

  • Type
    Type
    Type
    Type

    The type of the PnpObject.

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

    Property Value

Methods

  • CreateFromIdAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,System.String,Windows.Foundation.Collections.IIterable{System.String})
    CreateFromIdAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,System.String,Windows.Foundation.Collections.IIterable{System.String})
    CreateFromIdAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,System.String,Windows.Foundation.Collections.IIterable{System.String})
    CreateFromIdAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,System.String,Windows.Foundation.Collections.IIterable{System.String})

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

    public static IAsyncOperation<PnpObject> CreateFromIdAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType type,System.String id,Windows.Foundation.Collections.IIterable{System.String} requestedProperties)public static IAsyncOperation<PnpObject> CreateFromIdAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType type,System.String id,Windows.Foundation.Collections.IIterable{System.String} requestedProperties)Public Static Function CreateFromIdAsync(type As Windows.Devices.Enumeration.Pnp.PnpObjectType,id As System.String,requestedProperties As Windows.Foundation.Collections.IIterable{System.String}) As IAsyncOperation( Of PnpObject )

    Parameters

    Returns

  • CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})
    CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})
    CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})
    CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})

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

    public static PnpObjectWatcher CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties)public static PnpObjectWatcher CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties)Public Static Function CreateWatcher(type As Windows.Devices.Enumeration.Pnp.PnpObjectType,requestedProperties As Windows.Foundation.Collections.IIterable{System.String}) As PnpObjectWatcher

    Parameters

    Returns

    Remarks

    CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String) 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(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)
    CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)
    CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)
    CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)

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

    public static PnpObjectWatcher CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties,System.String aqsFilter)public static PnpObjectWatcher CreateWatcher(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties,System.String aqsFilter)Public Static Function CreateWatcher(type As Windows.Devices.Enumeration.Pnp.PnpObjectType,requestedProperties As Windows.Foundation.Collections.IIterable{System.String},aqsFilter As System.String) As PnpObjectWatcher

    Parameters

    • type

      The type of the PnpObject.

    • 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
      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

  • FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})
    FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})
    FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})
    FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String})

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

    public static IAsyncOperation<PnpObjectCollection> FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties)public static IAsyncOperation<PnpObjectCollection> FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties)Public Static Function FindAllAsync(type As Windows.Devices.Enumeration.Pnp.PnpObjectType,requestedProperties As Windows.Foundation.Collections.IIterable{System.String}) As IAsyncOperation( Of PnpObjectCollection )

    Parameters

    Returns

    • An object that represents the asynchronous operation.

  • FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)
    FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)
    FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)
    FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType,Windows.Foundation.Collections.IIterable{System.String},System.String)

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

    public static IAsyncOperation<PnpObjectCollection> FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties,System.String aqsFilter)public static IAsyncOperation<PnpObjectCollection> FindAllAsync(Windows.Devices.Enumeration.Pnp.PnpObjectType type,Windows.Foundation.Collections.IIterable{System.String} requestedProperties,System.String aqsFilter)Public Static Function FindAllAsync(type As Windows.Devices.Enumeration.Pnp.PnpObjectType,requestedProperties As Windows.Foundation.Collections.IIterable{System.String},aqsFilter As System.String) As IAsyncOperation( Of PnpObjectCollection )

    Parameters

    • type

      The type of the PnpObject.

    • 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
      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.

  • Update(Windows.Devices.Enumeration.Pnp.PnpObjectUpdate)
    Update(Windows.Devices.Enumeration.Pnp.PnpObjectUpdate)
    Update(Windows.Devices.Enumeration.Pnp.PnpObjectUpdate)
    Update(Windows.Devices.Enumeration.Pnp.PnpObjectUpdate)

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

    public void Update(Windows.Devices.Enumeration.Pnp.PnpObjectUpdate updateInfo)public void Update(Windows.Devices.Enumeration.Pnp.PnpObjectUpdate updateInfo)Public Function Update(updateInfo As Windows.Devices.Enumeration.Pnp.PnpObjectUpdate) As void

    Parameters

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.DualApiPartitionAttribute
Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.StaticAttribute
Windows.Foundation.Metadata.ThreadingAttribute
Windows.Foundation.Metadata.MarshalingBehaviorAttribute

Details

Assembly

Windows.Devices.Enumeration.Pnp.dll