继承考虑以下三个接口:明确C#接口实现,从其他接口
interface IBaseInterface
{
event EventHandler SomeEvent;
}
interface IInterface1 : IBaseInterface
{
...
}
interface IInterface2 : IBaseInterface
{
...
}
现在考虑下面的类同时实现IInterface1和IInterface 2:
class Foo : IInterface1, IInterface2
{
event EventHandler IInterface1.SomeEvent
{
add { ... }
remove { ... }
}
event EventHandler IInterface2.SomeEvent
{
add { ... }
remove { ... }
}
}
这导致因为SomeEvent不是IInterface1或IInterface2的一部分,所以它是IBaseInterface的一部分。
Foo类如何实现IInterface1和IInterface2?
我喜欢你的副臂,先生。 – anthony 2011-01-07 08:00:49