开发者

c# expose a class available in an assembly wrapped by your assembly

I am creating a wrapper class (say assembly D) that extends the implementation of one public class (say class X ) that is wrapped (say assembly B). Now there is another class (say class Y) in assembly B(wrapped) that I want to expose to the users. Now I have two options

Wrap class Y in assembly B and expose it to the users. The disadvantage of this option is that I will have to rewrite the exact implementation of class X in assembly B.

My question here is. Is it possible to somehow create a proxy class in assembly D that exposes class Y as it is.

Expose both assemblies to the users (and I am happy to do that) and somehow hide class X to users exposed in assembly B (because I have already wrapped class X in in assembly开发者_JAVA技巧 D). Remember I can't access code in assembly B.

My question here is. Is is possible to do option b. i.e somehow hide class X of assembly from users.


You could extend class Y in assembly D 'without' any changes:

public class Yex : Y { }

Then you only need to expose assembly D to the users because they can access Y per Yex.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜