Reading CustomProperties from EntityBase2

Posts   
 
    
Barry
User
Posts: 232
Joined: 17-Aug-2005
# Posted on: 10-Oct-2005 04:46:22   

I've defined a set of customer properties in each entity, my application will read those properties in presentation layer.

I've written some general logic in DataBindings_CollectionChanged event of my ui control to read customer properties from entity, and set different behaviours and look accroding to the value of customer properties.

Because the ui controls will be used in many forms and data bound to different entity, so I cannot hard coded entity name, like CustomerEntity.CustomProperties. I want to write a geranal routine to read customer properties from a EntityBase2 in DataBindings_CollectionChanged event, however, I find that CustomProperties doesn't exist in EntityBase2 rage

Any suggestion to write a general routine to read CustomProperties from entity? Thank you very much!!!

Walaa avatar
Walaa
Support Team
Posts: 14995
Joined: 21-Aug-2005
# Posted on: 10-Oct-2005 16:56:26   

You can use Reflection in dotNet to retrieve the type of the object in hand, and you may also create an instance based on that type.

Check the MSDN for the following titles: Reflection, Type & GetType()