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 PnpObjectpublic sealed 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 stringpublic string Id { get; }

    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>public IMapView<string, object> Properties { get; }

    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 PnpObjectTypepublic PnpObjectType Type { get; }

    Property Value

Methods

  • CreateFromIdAsync(PnpObjectType, String, IIterable<String>)
    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 )public static IAsyncOperation<PnpObject> CreateFromIdAsync(PnpObjectType type, String id, IIterable<String> requestedProperties)

    Parameters

    Returns

  • CreateWatcher(PnpObjectType, IIterable<String>)
    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 PnpObjectWatcherpublic static PnpObjectWatcher CreateWatcher(PnpObjectType type, IIterable<String> requestedProperties)

    Parameters

    Returns

    Remarks

    CreateWatcher(PnpObjectType, IIterable<String>, 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(PnpObjectType, IIterable<String>, String)
    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 PnpObjectWatcherpublic static PnpObjectWatcher CreateWatcher(PnpObjectType type, IIterable<String> requestedProperties, String aqsFilter)

    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(PnpObjectType, IIterable<String>)
    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 )public static IAsyncOperation<PnpObjectCollection> FindAllAsync(PnpObjectType type, IIterable<String> requestedProperties)

    Parameters

    Returns

    • An object that represents the asynchronous operation.

  • FindAllAsync(PnpObjectType, IIterable<String>, String)
    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 )public static IAsyncOperation<PnpObjectCollection> FindAllAsync(PnpObjectType type, IIterable<String> requestedProperties, String aqsFilter)

    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(PnpObjectUpdate)
    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 voidpublic void Update(PnpObjectUpdate updateInfo)

    Parameters

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

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

Details

Assembly

Windows.Devices.Enumeration.Pnp.dll