What I have is a collection of classes that all implement the same interface but can be pretty wildly different under the hood. I want to have a config file control which of the
Plenty of metaprogramming facilities.
Specifically, you can get a reference to the assembly that holds these classes, then easily get the Type
of a class from its name. See Assembly.GetType Method (String).
From there, you can instantiate the class using Activator
or the constructor of the Type
itself. See Activator.CreateInstance Method.
Once you have an instance, you can set properties by again using the Type
object. See Type.GetProperty Method and/or Type.GetField Method along PropertyInfo.SetValue Method.