Hi!
I am looking for an easy way to get a Type from a arbitrary string.
What I found looks like:
----
string TypeString = "System.String"; // only as example...
Type TypeIAmLookingFor = null;
Assembly[] appAssemblies =
System.AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly assembly in appAssemblies)
{
foreach (Type type in assembly.GetTypes())
{
if (t.ToString().Equals(TypeString))
TypeIAmLookingFor = type;
}
}
---
This is kind of overloaded; is there are more easy way to do this?
Thank you!
Ruben