MiracastReceiverSession.Disconnected 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当 MiracastReceiverConnection 被 Miracast 发送器断开连接时引发的事件。
// Register
event_token Disconnected(TypedEventHandler<MiracastReceiverSession, MiracastReceiverDisconnectedEventArgs const&> const& handler) const;
// Revoke with event_token
void Disconnected(event_token const* cookie) const;
// Revoke with event_revoker
MiracastReceiverSession::Disconnected_revoker Disconnected(auto_revoke_t, TypedEventHandler<MiracastReceiverSession, MiracastReceiverDisconnectedEventArgs const&> const& handler) const;
public event TypedEventHandler<MiracastReceiverSession,MiracastReceiverDisconnectedEventArgs> Disconnected;
function onDisconnected(eventArgs) { /* Your code */ }
miracastReceiverSession.addEventListener("disconnected", onDisconnected);
miracastReceiverSession.removeEventListener("disconnected", onDisconnected);
- or -
miracastReceiverSession.ondisconnected = onDisconnected;
Public Custom Event Disconnected As TypedEventHandler(Of MiracastReceiverSession, MiracastReceiverDisconnectedEventArgs)
事件类型
注解
在调用 MiracastReceiverSession.Start 或 MiracastReceiverSession.StartAsync 方法之前,应用必须订阅此事件。
如果应用本身请求断开连接连接(例如,通过调用 Disconnect 方法),则不会引发 该事件。
应用应检查 MiracastReceiverDisconnectedEventArgs.Connection 属性来确定哪个连接已断开连接,因为 MiracastReceiverSession 可以处理多个连接。