Upravit

Sdílet prostřednictvím


winrt::deferrable_event_args struct template (C++/WinRT)

A type that you can use to implement (produce) the deferrable event pattern. For more info, and code examples, see Deferrable events.

Syntax

template<typename D>
struct deferrable_event_args

Template parameters

typename D The type of the event args of the deferrable event.

Requirements

Minimum supported SDK: Currently in Windows SDK Insider Preview

Namespace: winrt

Header: $(ProjectDir)Generated Files\winrt\Windows.Foundation.h

Member functions

Function Description
deferrable_event_args::GetDeferral function Called by the event recipient in order to retrieve a deferral.
deferrable_event_args::wait_for_deferrals function Completes when all outstanding deferrals have completed (if no deferrals were taken, then it completes immediately).

deferrable_event_args::GetDeferral function

Called by the event recipient in order to retrieve a deferral. Doing so indicates to the event source that post-event activities should be postponed until Complete has been called on the deferral. This allows an event handler to perform asynchronous actions in response to an event.

Syntax

winrt::Windows::Foundation::Deferral GetDeferral();

Return value

A Windows::Foundation::Deferral object.

deferrable_event_args::wait_for_deferrals function

Completes when all outstanding deferrals have completed (if no deferrals were taken, then it completes immediately).

Syntax

winrt::Windows::Foundation::IAsyncAction wait_for_deferrals();

Return value

A Windows::Foundation::IAsyncAction object.

See also