DeviceWatcher.Updated 事件

定義

在列舉裝置集合中更新裝置時所引發的事件。

// Register
event_token Updated(TypedEventHandler<DeviceWatcher, DeviceInformationUpdate const&> const& handler) const;

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

// Revoke with event_revoker
DeviceWatcher::Updated_revoker Updated(auto_revoke_t, TypedEventHandler<DeviceWatcher, DeviceInformationUpdate const&> const& handler) const;
public event TypedEventHandler<DeviceWatcher,DeviceInformationUpdate> Updated;
function onUpdated(eventArgs) { /* Your code */ }
deviceWatcher.addEventListener("updated", onUpdated);
deviceWatcher.removeEventListener("updated", onUpdated);
- or -
deviceWatcher.onupdated = onUpdated;
Public Custom Event Updated As TypedEventHandler(Of DeviceWatcher, DeviceInformationUpdate) 

事件類型

備註

注意

當有裝置新增、移除或更新時,應用程式必須訂閱所有 新增移除和更新的事件。 如果應用程式只處理 新增 的事件,如果在初始裝置列舉完成之後將裝置新增至系統,則不會收到更新。

適用於