Page MenuHomePhabricator

C#: Remove static_cast method
Closed, ResolvedPublic

Description

Evaluate if we can remove the static_cast method from the generated code API..

It is used whenever we receive a generic Efl.Object and want to downcast it.

One approach would be to rework the generated code to make use of reflection and the class register database to create a correct instance before returning the Efl.Object. In this case the user would need to do only something like var button = obj as Efl.Ui.Button.

lauromoura triaged this task as High priority.

Using the language mechanisms for casting (obj as Efl.Ui.Button) sounds better than having a custom method, from an API point of view. I do not know how hard that is, though.