...but this all is already possible using the System.CodeDom.Compiler Namespace.
There you can Simply Create a CSharp or VB Compiler and add own (living!!!!) classes in form of object references and / or library references.
Create a Compiler (CSharp or VB) and use the following statements to create an assembly type object.
ICodeCompiler.CompileAssemblyFromFile()
ICodeCompiler.CompileAssemblyFromSource()
CompilerParameters.ReferencedAssemblies Property
You can Add living objects Using Interface Definitions in an external DLL that is to be implemented in the Script Code an called from external code.
This is done by searching for your interface in that created assembly and then assigning the object in that assembly to your Interface... and now you're able to control your script's methods and give 'em over what you want, as long as you add a reference to the classes' definition using CompilerParameters.ReferencedAssemblies before compiling the code!!! You can also use AppDomians to start your very own App using "scripts".
hope i helped you out!
regards
Manuel!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
- the System.DodeDom.Compiler Namespace is not available on the Compact Framework
=> this might be enough to legalize my work ;-),
I needed it on the Pocket PC platform.
In addition, I think there is a big difference between having an enduser coding classes and objects, etc. or providing the enduser with some simple directions on what he/she can do
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK, I did not review capabilities of .NET on CE. This was my fault :o).
Simplifying enduser script creation (on non-CE Platforms) can also be done using the suggested CodeDom solution, as you can wrap your own sources around what endusers implement (Interface implementation can be hidden from user)...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
...but this all is already possible using the System.CodeDom.Compiler Namespace.
There you can Simply Create a CSharp or VB Compiler and add own (living!!!!) classes in form of object references and / or library references.
Create a Compiler (CSharp or VB) and use the following statements to create an assembly type object.
ICodeCompiler.CompileAssemblyFromFile()
ICodeCompiler.CompileAssemblyFromSource()
CompilerParameters.ReferencedAssemblies Property
You can Add living objects Using Interface Definitions in an external DLL that is to be implemented in the Script Code an called from external code.
This is done by searching for your interface in that created assembly and then assigning the object in that assembly to your Interface... and now you're able to control your script's methods and give 'em over what you want, as long as you add a reference to the classes' definition using CompilerParameters.ReferencedAssemblies before compiling the code!!! You can also use AppDomians to start your very own App using "scripts".
hope i helped you out!
regards
Manuel!
Hi Manuel,
thanks for your hint, but I already knew that.
The following things made me doing the work:
- the System.DodeDom.Compiler Namespace is not available on the Compact Framework
=> this might be enough to legalize my work ;-),
I needed it on the Pocket PC platform.
In addition, I think there is a big difference between having an enduser coding classes and objects, etc. or providing the enduser with some simple directions on what he/she can do
OK, I did not review capabilities of .NET on CE. This was my fault :o).
Simplifying enduser script creation (on non-CE Platforms) can also be done using the suggested CodeDom solution, as you can wrap your own sources around what endusers implement (Interface implementation can be hidden from user)...