I would like to ensure that I only subscribe once in a particular class for an event on an instance.
For example I would like to be able to do the following:
I did this recently and I'll just drop it here so it stays:
private bool subscribed; if(!subscribed) { myClass.MyEvent += MyHandler; subscribed = true; } private void MyHandler() { // Do stuff myClass.MyEvent -= MyHandler; subscribed = false; }