RemoteSystemWatcher.ErrorOccurred 事件

定义

在发现过程中发生错误时,将引发此事件。 如果可能,发现过程将继续。 例如,如果发生错误时值为 RemoteSystemWatcherError.InternetNotAvailable (请参阅 RemoteSystemWatcherError) ,则近端发现将继续,因为此错误仅适用于云发现 (请参阅 RemoteSystemDiscoveryType) 。

// Register
event_token ErrorOccurred(TypedEventHandler<RemoteSystemWatcher, RemoteSystemWatcherErrorOccurredEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
RemoteSystemWatcher::ErrorOccurred_revoker ErrorOccurred(auto_revoke_t, TypedEventHandler<RemoteSystemWatcher, RemoteSystemWatcherErrorOccurredEventArgs const&> const& handler) const;
public event TypedEventHandler<RemoteSystemWatcher,RemoteSystemWatcherErrorOccurredEventArgs> ErrorOccurred;
function onErrorOccurred(eventArgs) { /* Your code */ }
remoteSystemWatcher.addEventListener("erroroccurred", onErrorOccurred);
remoteSystemWatcher.removeEventListener("erroroccurred", onErrorOccurred);
- or -
remoteSystemWatcher.onerroroccurred = onErrorOccurred;
Public Custom Event ErrorOccurred As TypedEventHandler(Of RemoteSystemWatcher, RemoteSystemWatcherErrorOccurredEventArgs) 

事件类型

Windows 要求

设备系列
Windows 10, version 1803 (在 10.0.17134.0 中引入)
API contract
Windows.Foundation.UniversalApiContract (在 v6.0 中引入)

注解

此事件的侦听器应通知用户遇到的错误类型。 有关详细信息,请参阅 RemoteSystemWatcherError 枚举。

适用于