Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unsubscribe all event handler of all events
Message
De
03/05/2009 02:48:57
 
 
À
02/05/2009 22:35:31
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 3.0
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01397637
Message ID:
01397644
Vues:
41
Why do you want to do this?

Update : I can guess. You could try using the System.WeakReference class instead. Here's an example:
http://blog.codeinreview.com/post/2008/11/27/NET-EVENTS-(Part-3-A-Weak-Solution).aspx
HTH,
Viv


>Hi,
>How could I unsubscribe all event handlers of all events of my object?
>For example, I have a classA, which contains events OnSomethingHappen and OnSomethingNotHappen. During Dispose, I would like to unsubscribe all event handler that attached to these events.
>
>Remark: the code should be dynamic as I would like to auto unsubscribe for all without need to hardcode them differently for each class.
>
>Please advice.
>
>Thank you
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform