Is it possible to loop through each class in a namespace and initialize an object for each class?
For instance, I want to loop through all classes in the Test.POS namespace, create an object for each class, and call the runImportProcess
method on each object.
I know that I can loop through a namespace like so:
Type[] typelist = GetTypesInNamespace(Assembly.GetExecutingAssembly(),
"Test.POS");
foreach (Type t in typelist)
{
Console.WriteLine(t.Name);
}
I'm not sure if it's possible to use this t
variable to accomplish what I want. Any insight for a novice?