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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top