forked from microsoft/cppwinrt
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationfeatureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Follow up #23. Currently, C++/WinRT requires three overloads of the member function named Event for registering and unregistering event handlers:
winrt::event_token Event(EventHandler);
Class::Event_revoker Event(winrt::auto_revoker_t, EventHandler);
void Event(winrt::event_token);When the option -ms-extension-property is enabled, a type winrt::auto_revoker_type_t should be added, and the member __declspec(property(get = _get_Event_register)) T Event; should be defined, where T holds a reference to the current object, and T defines
winrt::event_token operator+=(EventHandler);
Class::Event_revoker operator+=(winrt::auto_revoker_type_t<EventHandler>);
void operator-=(winrt::event_token)and winrt::auto_revoker_t is no longer needed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationfeatureNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed