Heh, an auto-moderator bounced me. :P Trying again (as requested), see my comments below.
John. >-----Original Message----- >From: John Elliot [mailto:[EMAIL PROTECTED] >Sent: Friday, 9 April 2004 1:30 AM >To: 'Moderated discussion of advanced .NET topics.' >Subject: RE: [ADVANCED-DOTNET] Delegate Invocation Lists > >>Would it be acceptable practice for an event handler to unsubscribe >itself >>whilst handling an event? > >Sure. Why is it that you'd want to do this? Do you only want to receive >the event once? > >>My concern here lies with ... >> >>* corruption of the delegate invocation list whilst the event publisher >is >>still busy publishing. > >Won't happen. Delegates are immutable. The 'event' keyword actually does >some funky stuff on your class, and the +=, -=, operators are deceptive. >Check out the 'add' and 'remove' C# keywords (which don't get proper >syntax highlighting in C#!) and the doco for MulticastDelegate. > >>* blocking of the event handler until the event publisher has completed >>processing the list > >I'm not really sure what you mean by this, but the invocation list is >dispatched synchronously on the thread that invokes the delegate. > >John. =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
