vendredi 26 juin 2015

How to make "as Class", Where Class is string name?

I have a collection of classes at my system. So, also i have a simple config file with collection of class names.

And i want to run code like this:

(object as Class).name="some text"; 

Where Class is his class name string from config file. May be i should use a refletion to do this?

Thank you!





Aucun commentaire:

Enregistrer un commentaire