UserDataProtectionManager.DataAvailabilityStateChanged 事件

定义

当数据可用性的状态发生更改时,此事件将调用侦听器。 例如,当设备锁定时,受“WhileUnlocked”UserDataAvailability 保护的数据将不可用。 可以通过订阅此事件来侦听此状态更改。

// Register
event_token DataAvailabilityStateChanged(TypedEventHandler<UserDataProtectionManager, UserDataAvailabilityStateChangedEventArgs const&> const& handler) const;

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

// Revoke with event_revoker
UserDataProtectionManager::DataAvailabilityStateChanged_revoker DataAvailabilityStateChanged(auto_revoke_t, TypedEventHandler<UserDataProtectionManager, UserDataAvailabilityStateChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<UserDataProtectionManager,UserDataAvailabilityStateChangedEventArgs> DataAvailabilityStateChanged;
function onDataAvailabilityStateChanged(eventArgs) { /* Your code */ }
userDataProtectionManager.addEventListener("dataavailabilitystatechanged", onDataAvailabilityStateChanged);
userDataProtectionManager.removeEventListener("dataavailabilitystatechanged", onDataAvailabilityStateChanged);
- or -
userDataProtectionManager.ondataavailabilitystatechanged = onDataAvailabilityStateChanged;
Public Custom Event DataAvailabilityStateChanged As TypedEventHandler(Of UserDataProtectionManager, UserDataAvailabilityStateChangedEventArgs) 

事件类型

适用于