I just realized I don't fully understand why in .NET you assign events using a += symbol.
I figured this out yesterday when I needed to remove an event and without thinking I was doing
someobject.onsomeevent += null
thinking that would just remove the event I had previously assigned.
After some investigation, I figured out I had to
someobject.onsomeevent -= someeventmethod;
After figuring this out, I realized I don't understand how event methods are assigned in .NET.
So I have a few questions:
First, does it mean that I can do
someobject.onsomeevent += someeventmethod;
someobject.onsomeevent += someeventothermethod;
If so, when onsomeevent occurs will they both get hit, and in the order specified or simultaneously?
Furthermore, how can I determine what event methods are already assigned to someobject.onsomeevent?
Second, is there a way to save the events methods in some class, remove them from someobject.onsomeevent and re-assign them after some other procedures that would normally trigger the event are complete?