bobjanova (bobjanova) wrote in ncommunity,
bobjanova
bobjanova
ncommunity

Delegates at runtime

I have written an interpreter in C#, and I use System.Reflection to let the user access the Framework (create new objects, access methods and so on). There is only one problem that I can't deal with: there doesn't seem to be a way of creating event handlers dynamically, as delegates don't have constructors.

Am I missing something really obvious? The only way I could think to do it would be to use System.Reflection.Emit to create a temporary assembly with a method of the right signature and attach a delegate to that, and that seems very long-winded.
  • Post a new comment

    Error

    default userpic

    Your IP address will be recorded 

  • 3 comments