共用方式為


PnpObject 類別

定義

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

表示 PnP 物件。 這個類別允許存取 PnP 物件的已知屬性,以及要從 PnP 物件擷取之其他屬性的屬性存放區。

public ref class PnpObject sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PnpObject final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PnpObject
Public NotInheritable Class PnpObject
繼承
Object Platform::Object IInspectable PnpObject
屬性

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

屬性

Id

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

字串,表示 PnpObject的身分識別。

Properties

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

屬性存放區,其中包含已知的值,以及其他指定的屬性。

Type

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

PnpObject的類型。

方法

CreateFromIdAsync(PnpObjectType, String, IIterable<String>)

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

從先前儲存的DeviceInformation識別碼,以非同步方式建立PnpObject物件。

CreateWatcher(PnpObjectType, IIterable<String>)

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

會傳回 PnpObjectWatcher 物件,用來使用事件列舉集合中的 PnP 物件。

CreateWatcher(PnpObjectType, IIterable<String>, String)

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

會傳回 PnpObjectWatcher 物件,用來列舉使用事件列舉 PnP 物件的篩選集合。

FindAllAsync(PnpObjectType, IIterable<String>)

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

傳回符合指定準則之指定型別的所有 PnP 物件。

FindAllAsync(PnpObjectType, IIterable<String>, String)

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

傳回符合指定篩選之指定型別的所有 PnP 物件。

Update(PnpObjectUpdate)

重要

我們不再建議您使用 Windows.Devices.Enumeration.Pnp 命名空間中的類型。 相反地, Windows.Devices.Enumeration 命名空間中的類型會實作新式且更妥善維護的 Windows.Devices.Enumeration.Pnp功能超集合。

PnpObjectType的替代方法是Windows.Devices.Enumeration.DeviceInformationKind列舉,您可以將其當做參數傳遞至Windows.Devices.Enumeration API。 例如,當您建立PnpObjectWatcher時,不要使用PnpObjectType,而是在建立DeviceWatcher時使用DeviceInformationKind

匯報現有PnpObject的屬性,方法是套用PnpObjectUpdate物件中所述的變更。

適用於