How can I write a generic container class that implements a given interface in C#?

后端 未结 7 1740
太阳男子
太阳男子 2020-12-02 16:17

Context: .NET 3.5, VS2008. I\'m not sure about the title of this question, so feel free to comment about the title, too :-)

Here\'s the scenario: I have several cla

7条回答
  •  一生所求
    2020-12-02 16:19

    If I understand correctly, you are asking for an implementation of the "GroupGenerator".

    Without any real experience with CastleProxy my recommendation would be to use GetMethods() to get the initial methods listed in the interface and then create a new type on the fly using Reflection.Emit with the new methods that enumerate through the objects and call each corresponding method. The performance shouldn't be too bad.

提交回复
热议问题