Base class:
Public MustInherit Class Connector
Public Event Changed as EventHandler
End Class
Interface:
Public Interface IPlug
Event Changed as EventHandler
End Interface
Derived class:
Public Class OutputConnector
Inherits Connector
Implements IPlug
Event Changed as EventHandler Implements IPlug.Changed
End Class
VB.Net Problem:
The Changed
event in OutputConnector
conflicts with the Changed
event in Connector
, of course. But I have to implement it to satisfy the IPlug
interface.
How can I solve this?
I have other classes deriving from Connector
(e.g. an InputConnector
class) that need to have the Changed
event, but NOT implement IPlug
. And I don't want derived classes that are implementing IPlug
to have an additional event just to avoid the name conflict (which would be the case if I changed the name of the event in either the base class or the interface).
Any suggestions?
Edit:
The problem is not the names per se, but that I want the derived class to somehow map its interface event implementation to the existing event in the base class - and not have to declare an additional event in the derived class (with all sorts of routing clutter to boot); after all, the event already exists in the base class! What I need is a way to let the interface know that..
A pseudo-solution (just to illustrate) would be to be able to put something to the effect of
Public Event MyBase.Changed Implements IPlug.Changed
in the derived OutputConnector
class.