PhoneLine.FromIdAsync(Guid) Metode

Definisi

Metode statis ini secara asinkron mengambil objek PhoneLine yang mewakili saluran telepon tertentu pada perangkat berdasarkan ID baris.

public:
 static IAsyncOperation<PhoneLine ^> ^ FromIdAsync(Platform::Guid lineId);
/// [Windows.Foundation.Metadata.RemoteAsync]
 static IAsyncOperation<PhoneLine> FromIdAsync(winrt::guid const& lineId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<PhoneLine> FromIdAsync(Guid lineId);
function fromIdAsync(lineId)
Public Shared Function FromIdAsync (lineId As Guid) As IAsyncOperation(Of PhoneLine)

Parameter

lineId
Guid

Platform::Guid

winrt::guid

ID baris saluran telepon yang akan diambil.

Mengembalikan

Operasi asinkron yang mengembalikan objek PhoneLine yang mewakili saluran telepon tertentu pada perangkat berdasarkan ID baris. Ini akan melemparkan pengecualian pada kegagalan.

Atribut

Persyaratan Windows

Kemampuan aplikasi
phoneCallHistory phoneCallHistorySystem

Keterangan

Contoh berikut menunjukkan cara mendapatkan PhoneLine default.

private async Task<PhoneLine> GetDefaultPhoneLineAsync()
{
    PhoneCallStore phoneCallStore = await PhoneCallManager.RequestStoreAsync();
    Guid lineId = await phoneCallStore.GetDefaultLineAsync();
    PhoneLine line = null;
    try
    {
        line = await PhoneLine.FromIdAsync(lineId);
    }
    catch (Exception ex)
    {
        Logger.Instance.LogErrorMessage($"PhoneLine.FromIdAsync failed:{ex.Message}");
    }
return line;
}

Berlaku untuk