Skip to content

Commit

Permalink
Fixed special cased event source (#866)
Browse files Browse the repository at this point in the history
  • Loading branch information
ujjwalchadha authored Jun 11, 2021
1 parent e372646 commit dbcf290
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Binary file not shown.
7 changes: 3 additions & 4 deletions src/cswinrt/code_writers.h
Original file line number Diff line number Diff line change
Expand Up @@ -2529,11 +2529,10 @@ db_path.stem().string());
{
if (for_typedef(w, get_type_semantics(evt.EventType()), [&](TypeDef const& eventType)
{
if (eventType.TypeNamespace() == "System" && eventType.TypeName() == "EventHandler`1")
if ((eventType.TypeNamespace() == "Windows.Foundation" || eventType.TypeNamespace() == "System") && eventType.TypeName() == "EventHandler`1")
{
auto [add, remove] = get_event_methods(evt);
w.write(R"(
new EventSource__EventHandler%(_obj,
w.write(R"( new EventSource__EventHandler%(_obj,
%,
%))",
bind<write_type_params>(eventType),
Expand Down Expand Up @@ -6458,7 +6457,7 @@ bind<write_type_name>(type, typedef_name_type::CCW, true)
{
for_typedef(w, eventTypeSemantics, [&](TypeDef const& eventType)
{
if (eventType.TypeNamespace() == "System" && eventType.TypeName() == "EventHandler`1")
if ((eventType.TypeNamespace() == "Windows.Foundation" || eventType.TypeNamespace() == "System") && eventType.TypeName() == "EventHandler`1")
{
return;
}
Expand Down

0 comments on commit dbcf290

Please sign in to comment.