Page MenuHomePhabricator

C#: Support emitting events from C# implementation of Efl interfaces
Open, HighPublic


When subclassing/implementing Efl classes from C#, the user may want to trigger events from the parent/class interface.

For example, one may want to implement Efl.Model in C# and set it as the model of a widget. Then, when the C# model instance triggers an event, like properties,changed, the C listener is notified.

Regular classes can trigger its parents events through the methods On*. Meanwhile, for interfaces, no connection is currently made. Probably the interface implementer would have to manually wrap his interface instance in the *Concrete class and call the OnEVENT method.

One alternative could be using reflection - as is already used to pick the interfaces to be passed to the Eo constructor - and connect C# hooks to the interface events, so when a C# event is triggered, it is forwared to the corresponding Eo interface event.

A test case is available at devs/lauromoura/interface_events.