这似乎是一个合理的(也许是简单的?)场景,但您将如何执行以下操作:
可以说我有2个接口:
Interface ISimpleInterface
string ErrorMsg { get; }
End Interface
Interface IExtendedInterface
string ErrorMsg { get; set; }
string SomeOtherProperty { get; set; }
End Interface
Run Code Online (Sandbox Code Playgroud)
我想要一个类来实现这两个接口:
Public Class Foo Implements ISimpleInterface, IExtendedInterface
Run Code Online (Sandbox Code Playgroud)
如果每个接口具有不同的访问级别,如何在类中定义ErrorMsg属性?
以下是我想知道的情况:我正在使用伪造的MVC架构编写UserControl,其中UserControl将扩展接口暴露给它的Controller,并将Simple接口暴露给控件的使用者.
顺便说一句,在VB.NET中实现这一点(vb中的任何建议的synatx将不胜感激).