PhoneLine.LineChanged 事件

定义

当关联的 PhoneLine 实例的 和 属性更改时发生。 当元数据更改(如语音邮件计数、网络状态或手机网络详细信息)时,可能会发生这种情况。

// Register
event_token LineChanged(TypedEventHandler<PhoneLine, IInspectable const&> const& handler) const;

// Revoke with event_token
void LineChanged(event_token const* cookie) const;

// Revoke with event_revoker
PhoneLine::LineChanged_revoker LineChanged(auto_revoke_t, TypedEventHandler<PhoneLine, IInspectable const&> const& handler) const;
public event TypedEventHandler<PhoneLine,object> LineChanged;
function onLineChanged(eventArgs) { /* Your code */ }
phoneLine.addEventListener("linechanged", onLineChanged);
phoneLine.removeEventListener("linechanged", onLineChanged);
- or -
phoneLine.onlinechanged = onLineChanged;
Public Custom Event LineChanged As TypedEventHandler(Of PhoneLine, Object) 

事件类型

Windows 要求

应用功能
phoneCallHistory phoneCallHistorySystem

注解

以下示例演示如何监视和更新网络状态。

private async void MonitorLineChanges(Guid lineId)
{
    // Get the PhoneLine instance
    PhoneLine line = await PhoneLine.FromIdAsync(lineId);

    PhoneNetworkState updatedNetworkState;
    string updatedNetworkName;

    line.LineChanged += (o, args) =>
    {
        updatedNetworkState = line.NetworkState;
        updatedNetworkName = line.NetworkName;
    };
}

适用于