Dave,
In addition to what Codemonkey stated:
Is there a way to force a derived class to contain an event.
A derived class will always contain (expose) the event, unfortunately there
is no real way to force a derived class to raise an event. What we normally
do is give derived classes the opportunity to raise the base classes events,
then take it on faith they will use it appropriately.
The Event Usage Guidelines in the Design Guidelines for Class Library
Developers, has defined a pattern that allows derived classes to raise an
event of a base class.
http://msdn.microsoft.com/library/d...s/cpgenref/html/cpconEventUsageGuidelines.asp
Public Class Base
Public Event NameChanged(sender as Object, e as EventArgs)
Protected Overrideable Sub OnNameChanged(e as EventArgs)
RaiseEvent NameChanged(me, e)
End Sub
Public Property Name() As String
...
Set(ByVal value As String)
...
OnNameChanged(EventArgs.Empty)
...
End Set
End Property
End Class
When ever the base class or derived classes need to raise the NameChanged
event they call the OnNameChanged method. Derived classes can override this
method to replace or supplement what happens when the NameChanged event
occurs. Which means if the derived classes still want the event to be raised
they need to use MyBase.OnNameChanged in their overridden OnNameChanged.
Which is similar to what Codemonkey showed. If the above does not address
your needs then a variation of what Codemonkey may be what you need.
Hope this helps
Jay