I have a class named
MyClass that has an instance method named
MyHandler . There are two instances of
MyClass , and an instance of another class named
anotherClassInstance . Within each instance of
MyClass , the following code gets executed:
anotherClassInstance.SomeEvent += MyHandler
MyClass also contains the code:
anotherClassInstance.SomeEvent -= MyHandler
So my question is, when the latter code gets executed (for removing the event handler), will it only remove the handler for the specific
MyClass instance in which its executed? I worry that maybe it also removes the handler for the other
MyClass instance.