Article View: borland.public.csharpbuilder.language.csharp
Article #201Re: Custom Delegation
From: Marc Rohloff TeamB
Date: Tue, 30 May 2006 00:59
Date: Tue, 30 May 2006 00:59
29 lines
1979 bytes
1979 bytes
On Mon, 29 May 2006 16:04:49 +0200, Andre wrote:
>> almost anything could happen.
>> The best practice is probably to always remove the events.
>
> by this you mean that i should define special 'remove' for my event like
> {
> public event eventHandler onEvent
> {
> remove {//// some cleanup code }
> }
>
> and then use -= in object dispose.
> }
> or
> {
> just use the -= in object dispose.
> }
I am not sure where you are going.
What I meant is that if you subscribe for an event then you should
unsubscribe when you are finished or when you are disposed.
If you are writing event properties you should probably stick with the
default implementation.
--
Marc Rohloff [TeamB]
marc rohloff -at- myrealbox -dot- com
Technical Details
Message-ID:
<1ol94ym2046bi$.dlg@dlg.marcrohloff.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news1.google.com!news.germany.com!news.osn.de!diablo2.news.osn.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<447aa0bd@newsgroups.borland.com> <15xbx0js9z62p.dlg@dlg.marcrohloff.com> <447aff84@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 1efe35,bb4758d9cad65d98 X-Google-Attributes: gid1efe35,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Marc Rohloff [TeamB]" <"on request"> Subject: Re: Custom Delegation Newsgroups: borland.public.csharpbuilder.language.csharp User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: <447aa0bd@newsgroups.borland.com> <15xbx0js9z62p.dlg@dlg.marcrohloff.com> <447aff84@newsgroups.borland.com> Date: Mon, 29 May 2006 20:59:00 -0400 Message-ID: <1ol94ym2046bi$.dlg@dlg.marcrohloff.com> X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ :0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR X-Antivirus: avast! (VPS 0622-1, 05/29/2006), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 65.31.1.121 X-Trace: newsgroups.borland.com 1148950733 65.31.1.121 (29 May 2006 17:58:53 -0700) Lines: 29 X-Authenticated-User: mrohloff Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news1.google.com!news.germany.com!news.osn.de!diablo2.news.osn.de!news.belwue.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail