Feeds:
Posts
Comments

Posts Tagged ‘Reflection’

I had to face up this problem one day, build a type from its name. I had a lot of XML files containing the type name and while i was parsing these files, i created dynamically the type like this :

string stringType = "MyTypeToFound";
Assembly   asb=  Assembly.GetAssembly(typeof(Galactics.MyAssembly.MyType));
Type type = Array.Find<Type>(asb.GetTypes(),_type =>   _type.Name.EndsWith(stringType));

Read Full Post »