开发者

Generating Interface Proxies

开发者 https://www.devze.com 2023-01-20 10:57 出处:网络
Ran into an issue with a class; I have a class that looks like: public class MyPresenter { public MyPresenter(IMyView view) { }

Ran into an issue with a class; I have a class that looks like:

public class MyPresenter
{
    public MyPresenter(IMyView view) { }
}

public class SomePresenter
{
    public SomePresenter(ISomeView view) { }
}

The custom views inherit from a base IView instance. I ran into a situation where I need to create a custom class on the fly that implements IMyView or ISomeView (depending on some scenario) and access the model, and I was thinking I could use a tool like Ca开发者_高级运维stle DynamicProxy to do it. But I'm not quite sure where to start, and I need to be able to create a custom IMyView or other class instance on the fly.

Thanks.


When I needed proxies, I found this tutorial from Krzysztof Koźmic to be invaluable.

0

精彩评论

暂无评论...
验证码 换一张
取 消