Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Mixing Dynamic code with non-dynamic code.

Mixing Dynamic code with non-dynamic code.

Scheduled Pinned Locked Moved C#
csharpc++toolshelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Red_Wizard_Shot_The_Food
    wrote on last edited by
    #1

    Hi all, I'm writing some code that I want to be part user generated part auto generated. The code will be C# but used as a script through embedding Mono in a c++ application. Ideally I want my users to use a graphical editor that will auto-generate the class and the constructor using info from the editor(I've done this using the AssemblyBuilder and Reflection.Emit) But then I want the user to be able to use a text editor to write an override for the Update() method then any number of public or private methods they wish to define. I want to be able to compile this hand-writen code (I'm doing this with the CSharpCodeProvider) but I want to inject it into the autogenerated code some how. So the class and constructor is auto-generated and the Update method and any number of other methods are handwritten in C# 2.0 and the results combined into a single dll. I hope this explanation makes sense.... can any one help? Thanks.

    N 1 Reply Last reply
    0
    • R Red_Wizard_Shot_The_Food

      Hi all, I'm writing some code that I want to be part user generated part auto generated. The code will be C# but used as a script through embedding Mono in a c++ application. Ideally I want my users to use a graphical editor that will auto-generate the class and the constructor using info from the editor(I've done this using the AssemblyBuilder and Reflection.Emit) But then I want the user to be able to use a text editor to write an override for the Update() method then any number of public or private methods they wish to define. I want to be able to compile this hand-writen code (I'm doing this with the CSharpCodeProvider) but I want to inject it into the autogenerated code some how. So the class and constructor is auto-generated and the Update method and any number of other methods are handwritten in C# 2.0 and the results combined into a single dll. I hope this explanation makes sense.... can any one help? Thanks.

      N Offline
      N Offline
      Natza Mitzi
      wrote on last edited by
      #2

      It seems like all of the code is dynamic. If the result is a single dll, then you can combine all code (text) right before compilation. If the result is two dlls or more, you can create an interface and then load the implementation of Update on runtime (there are many other ways...)

      Natza Mitzi Analysis Studio Statistical Analysis Software

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups