We often use event handler in C#, just as below:
some_event+=some_event_handler;
Does this happen at compile time or run time? What if the some_event is static member? AFAIK, the some_event contains nothing but the entry address of some_event_handler, and the method address of some_event_handler could be determined at compile time. If some_event is a static member, could the value of the some_event be determined at compile time? I konw that if the some_event is an instance member, it’s value will be setup at the creation time of the object instance. Correct me if I’m wrong.
Many thanks, guys~ 🙂
The subscription happens at run-time. It can be inside conditional.