Menu

Dont get me wrong...

2005-10-13
2013-03-08
  • Manuel Weinert

    Manuel Weinert - 2005-10-13

    ...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!

     
    • jalberti

      jalberti - 2005-11-07

      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

       
    • Manuel Weinert

      Manuel Weinert - 2005-11-10

      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)...

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.