description | title | ms.date | ms.topic | f1_keywords | helpviewer_keywords | ms.assetid | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: DeferrableEventArgs Class |
DeferrableEventArgs Class |
10/03/2018 |
reference |
|
|
ece89267-7b72-40e1-8185-550c865b070a |
A template class used for the event argument types for deferrals.
template <typename TEventArgsInterface, typename TEventArgsClass>
class DeferrableEventArgs : public TEventArgsInterface;
TEventArgsInterface
The interface type that declares the arguments for a deferred event.
TEventArgsClass
The class that implements TEventArgsInterface.
Name | Description |
---|---|
DeferrableEventArgs::GetDeferral | Gets a reference to the Deferral object which represents a deferred event. |
DeferrableEventArgs::InvokeAllFinished | Called to indicate that all processing to handle a deferred event is complete. |
Instances of this class are passed to event handlers for deferred events. The template parameters represent an interface that defines the details of the event arguments for a specific type of deferred event, and a class that implements that interface.
The class appears as the first argument to an event handler for a deferred event. You can call the GetDeferral method to get the Deferral object from which you can get all the information about the deferred event. After completing the event handling, you should call Complete on the Deferral object. You should then call InvokeAllFinished at the end of the event handler method, which ensures that the completion of all deferred events is communicated properly.
Header: event.h
Namespace: Microsoft::WRL
Gets a reference to the Deferral object which represents a deferred event.
HRESULT GetDeferral([out, retval] Windows::Foundation::IDeferral** result)
result
A pointer that will reference the Deferral object when the call completes.
S_OK if successful; otherwise, an HRESULT that indicates the error.
Called to indicate that all processing to handle a deferred event is complete.
void InvokeAllFinished()
You should call this method after the event source calls InvokeAll. Calling this method prevents further deferrals from being taken and forces the completion handler to execute if no deferrals were taken.