I\'m looking at taking a set of objects, let\'s say there\'s 3 objects alive at the moment, which all implement a common interface, and then wrap those objects inside a fourth o
(I'm justifying an answer here by adding extra context/info)
Yes, at the moment Reflection.Emit
is the only way to solve this.
In .NET 4.0, the Expression
class has been extended to support both loops and statement blocks, so for single method usage, a compiled Expression
would be a good idea. But even this won't support multi-method interfaces (just single-method delegates).
Fortunately, I've done this previously; see How can I write a generic container class that implements a given interface in C#?