Udostępnij za pośrednictwem


IStorageQueryResultBase.ContentsChanged Event

Definition

Fires when an item is added, deleted or modified in the folder being queried.

// Register
event_token ContentsChanged(TypedEventHandler<IStorageQueryResultBase, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
IStorageQueryResultBase::ContentsChanged_revoker ContentsChanged(auto_revoke_t, TypedEventHandler<IStorageQueryResultBase, IInspectable const&> const& handler) const;
event TypedEventHandler<IStorageQueryResultBase,object> ContentsChanged;
function onContentsChanged(eventArgs) { /* Your code */ }
iStorageQueryResultBase.addEventListener("contentschanged", onContentsChanged);
iStorageQueryResultBase.removeEventListener("contentschanged", onContentsChanged);
- or -
iStorageQueryResultBase.oncontentschanged = onContentsChanged;
Event ContentsChanged As TypedEventHandler(Of IStorageQueryResultBase, Object) 

Event Type

Remarks

If you register a handler for this event, keep that handler registered while you suspend your app (in response to oncheckpoint or Suspending). Your app will not receive ContentsChanged events while it is suspended and when your app resumes it will receive a single event that aggregates all of the changes if any occurred.

Additionally, keep in mind that registering and removing event handlers are synchronous operations and might cause your app to stop responding briefly if you execute them on your app's UI thread. Wherever possible, use a thread other than your app's UI thread to register and unregister these event handlers.

Applies to