创建一个实现内部接口类型创建一个、接口类型

2023-09-04 08:28:01 作者:等一个旧人

假设我有大会,宣布内部接口 IInternalInterface 。我要$ C $该组件的C无连接,我不能改变它。 如何创建我自己的实现 IInternalInterface

为什么我需要这样的:集包含的类的 IInternalInterface 执行者名单,我的目标是增加我自己的实现有

。 解决方案   

我如何创建我自己的实现IInternalInterface的?

答案很简单:你不能。如果程序集的作者决定,以纪念这个接口与内部则表示,他们不希望从其他程序集code使用这个接口。

Suppose I have assembly that declares internal interface IInternalInterface. I have no access to code of this assembly and I can't change it. How can I create my own implementation of IInternalInterface?

Why I need this: the assembly contains the class with list of IInternalInterface implementers and my goal is to add my own implementation there.

解决方案 19.6 创建Service接口及实现类 1

How can I to create my own implementation of IInternalInterface?

Simple answer: you can't. If the authors of the assembly decided to mark this interface with internal it means that they didn't want code from other assemblies to use this interface.