共用方式為


WiFiDirectDevice.ConnectionStatusChanged 事件

定義

發生于 Wi-Fi 直接裝置連線或中斷連線時。

// Register
event_token ConnectionStatusChanged(TypedEventHandler<WiFiDirectDevice, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
WiFiDirectDevice::ConnectionStatusChanged_revoker ConnectionStatusChanged(auto_revoke_t, TypedEventHandler<WiFiDirectDevice, IInspectable const&> const& handler) const;
public event TypedEventHandler<WiFiDirectDevice,object> ConnectionStatusChanged;
function onConnectionStatusChanged(eventArgs) { /* Your code */ }
wiFiDirectDevice.addEventListener("connectionstatuschanged", onConnectionStatusChanged);
wiFiDirectDevice.removeEventListener("connectionstatuschanged", onConnectionStatusChanged);
- or -
wiFiDirectDevice.onconnectionstatuschanged = onConnectionStatusChanged;
Public Custom Event ConnectionStatusChanged As TypedEventHandler(Of WiFiDirectDevice, Object) 

事件類型

備註

您可以新增 ConnectionStatusChanged 事件的處理常式,以在建立或中斷連線時收到通知。

適用於

另請參閱