Deriving an event

  • Thread starter Thread starter Carlos E. Hernandez
  • Start date Start date
C

Carlos E. Hernandez

I have a base class which have a delegate, and an event. I want to derive
this class and raise the event, so the consumer of the class will get the
event? But I get the following error

C:\Documents and Settings\Carlos\My Documents\Visual Studio
Projects\MetodosN\Classes\PuntoFijo.cs(143): The event
'MetodosN.EcuacionesLineales.MethodBase.UpdateGrid' can only appear on the
left hand side of += or -= (except when used from within the type
'MetodosN.EcuacionesLineales.MethodBase')

Thanks.
 
Carlos,

What you will have to do is expose a protected method on your base class
which will take the parameters to pass to the event to fire. An event can
only be fired from the class that exposes it.

Hope this helps.
 
Back
Top