[Mono-dev] inherited event

Michael Hutchinson m.j.hutchinson at gmail.com
Wed Feb 25 14:09:02 EST 2009


2009/2/25 Vladimir Giszpenc <vgiszpenc at dsci.com>:
> Hi,
>
> I was wondering why events have to be in local scope to be called.  If the
> event is in a base class, shouldn’t I be able to invoke it?
>
> This is not a bug in Mono as the behavior is the same on MS.Net, but I was
> hoping for some insight.

http://msdn.microsoft.com/en-us/library/hy3sefw3.aspx

The "protected virtual On{Event}" invoker pattern is useful because it
allows derived classes to handle the event with an override, and
control the emission of the event.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Mono-devel-list mailing list