All TermControl/TermApp/TermConnection event handlers should be TypedEventHandlers #1104
Labels
Area-TerminalControl
Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.)
In-PR
This issue has a related PR
Issue-Task
It's a feature request, but it doesn't really need a major design.
Needs-Tag-Fix
Doesn't match tag requirements
Product-Terminal
The new Windows Terminal.
Milestone
WinRT design guidelines dictate that event handlers should have two arguments,
T
andEventArgs
. For any classT
that produces an event, this ensures that the event handler can identify which instance ofT
fired the currently-handled event.Given that we are exposing an internal API, we can specify a more specific
T
thanIInspectable
.C++/WinRT supports this by way of
winrt::TypedEventHandler<T, Args...>
.We should move all the TermConnection, TermApp and TermControl event handlers to use
TypedEventHandler
s.bonus
We can get rid of
DECLARE_EVENT
andDEFINE_EVENT
, and augmentDECLARE_EVENT_WITH_TYPED_HANDLER
(andDEFINE...TYPED
) to usetypename class_type
as the sender type, so that we don't need to repeat ourselves:terminal/src/cascadia/inc/cppwinrt_utils.h
Lines 42 to 47 in 880272c
which, when used, becomes:
The text was updated successfully, but these errors were encountered: