.Net property import automatic code generation template?

(Phillip Watson) #1

Is there a template or config option somewhere that I can change so that when I import a .net interface with get/set properties that the generated Delphi property is not of format “get_[PropertyName]”
I would prefer that the property setter/getter was GetId/SetId rather than get_Id/set_Id
This format fits with our current coding practices and some of the properties that I am implementing from the .net interface already exist as properties on the original Delphi object. I don’t really want to have to change the names of all my existing getter/setters.


(antonk) #2


Note that the get_[PropertyName] / set_[PropertyName] naming pattern is how .NET actually defines these properties in the exposed COM interface. Auto-renaming these methods could possibly lead to duplicate names in the imported interfaces code and/or broken imports.

Just define corresponding Get[PropertyName] methods in your interface instead of properties.