Take the following C# class:
c1 {
event EventHandler someEvent;
}
If there are a lot of subscriptions to c1
's someEvent
event and I want to clear them all, what is the best way to achieve this? Also consider that subscriptions to this event could be/are lambdas/anonymous delegates.
Currently my solution is to add a ResetSubscriptions()
method to c1
that sets someEvent
to null. I don't know if this has any unseen consequences.