Loading .cs file from FileSystem as Object?
-
I create a class file dynamically and save it on the file system in a class.cs file. How can I load that file as a class object and bind it to PropertyGrid? Thanks.
You'll have to dynamically compile your generated class file (take a look at the
Microsoft.CSharp
andSystem.CodeDom.Compiler
namespace), load the generated assembly and create an object of your class usingActivator
class.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
I create a class file dynamically and save it on the file system in a class.cs file. How can I load that file as a class object and bind it to PropertyGrid? Thanks.
I guess you would have to compile the class into an assembly first. Then load the compiled assembly and create an instance of the class and then bind it to the propertygrid. If you need details, just ask.
-
I guess you would have to compile the class into an assembly first. Then load the compiled assembly and create an instance of the class and then bind it to the propertygrid. If you need details, just ask.