Lamp.FromIdAsync(String) 方法

定義

取得 Lamp 物件,表示具有指定識別碼的燈光裝置。

public:
 static IAsyncOperation<Lamp ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<Lamp> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<Lamp> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of Lamp)

參數

deviceId
String

Platform::String

winrt::hstring

所要求燈光裝置的識別碼。

傳回

非同步作業,會在成功完成時傳回 Lamp 物件。

屬性

備註

使用 GetDefaultAsync 取得裝置的預設燈。 將 GetDeviceSelector 方法傳回的類別選取字串傳遞至 FindAllAsyncCreateWatcher 方法,以列舉燈光裝置。 擷取之後,請使用 DeviceId 屬性來擷取相關聯燈光的識別碼。

適用於