I need to cast like this:
/* Cast Brakets */
(Type.FromString(mystring))myObject.doSomething();
I need to get the type that I cast at runtime, in this particular case I can't use a generic "T" class or method.
Although if you had a way of changing the T-generic Type at runtime (without calling a class or method again) that would also help.
Here is a more specific version of my problem:
I have a List comboList and my GUI can add new ComboBoxes at runtime, these will automatically be put into comboList. Now there are database tables for each of those ComboBoxes in comboList. I added the name of each of the database classes in the .Tag field of each ComboBox
(example: combobox_users.Tag = "users_databaseClass")
Now at runtime I need to cast into the type of users_databaseClass for example, but it appears to me that this is impossible. It appears that this is simply not possible to put a Type into cast-brackets at runtime to actually cast that type.
Help would be greatly appreciated, I've been trying for days.