Re: Consuming your own events.

Sebastien Lambla <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.clr
Message-ID <[email protected]>
Public override OnLoad()
{
        // do nothing and as such screw all the parent classes relying on
you
}

Only way to go around it is to code defensively and cumulate a RaiseLoad()
that in turns call the OnLoad virtual, and then raise the event.

--
SerialSeb
http://serialseb.blogspot.com


> -----Original Message-----
> From: Discussion of development on the .NET platform using any managed
> language [mailto:[email protected]] On Behalf Of Greg
> Young
> Sent: 28 January 2008 19:42
> To: [email protected]
> Subject: Re: [DOTNET-CLR] Consuming your own events.
>
> Events are slower than a simple virtual method call ... also if there
> is an exception in another event handler your code is not guarenteed
> to be called where as with the OnXXX pattern (event template methods)
> your code will be called before the event is actually raised.
>
> On Jan 28, 2008 8:59 AM, Brady Kelly <[email protected]> wrote:
> > I came across a mention in an article last year, advising on not
> consuming
> > your own events, e.g. not using a Form_Load handler on your form, but
> > overriding OnLoad.  What is the story behind this, and is it a UI
> thing I
> > should ask about elsewhere, or a more general pattern?
> >
> >
> > ===================================
> > This list is hosted by DevelopMentor(R)  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> http://discuss.develop.com
> >
>
>
>
> --
> Studying for the Turing test
>
> ===================================
> This list is hosted by DevelopMentorR  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.