WiFiDirectServiceAdvertiser.SessionRequested 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當 Seeker 要求與這個 WiFiDirectServiceAdvertiser 實例相關聯的服務建立會話時引發的事件。 若要接受要求,請在事件處理常式中呼叫 WiFiDirectServiceAdvertiser.ConnectAsync 。
// Register
event_token SessionRequested(TypedEventHandler<WiFiDirectServiceAdvertiser, WiFiDirectServiceSessionRequestedEventArgs const&> const& handler) const;
// Revoke with event_token
void SessionRequested(event_token const* cookie) const;
// Revoke with event_revoker
WiFiDirectServiceAdvertiser::SessionRequested_revoker SessionRequested(auto_revoke_t, TypedEventHandler<WiFiDirectServiceAdvertiser, WiFiDirectServiceSessionRequestedEventArgs const&> const& handler) const;
public event TypedEventHandler<WiFiDirectServiceAdvertiser,WiFiDirectServiceSessionRequestedEventArgs> SessionRequested;
function onSessionRequested(eventArgs) { /* Your code */ }
wiFiDirectServiceAdvertiser.addEventListener("sessionrequested", onSessionRequested);
wiFiDirectServiceAdvertiser.removeEventListener("sessionrequested", onSessionRequested);
- or -
wiFiDirectServiceAdvertiser.onsessionrequested = onSessionRequested;
Public Custom Event SessionRequested As TypedEventHandler(Of WiFiDirectServiceAdvertiser, WiFiDirectServiceSessionRequestedEventArgs)