Raising events vs direct method calls differences

前端 未结 6 2052
夕颜
夕颜 2021-02-04 11:27

Raising an event, will call its event handler. eg http://msdn.microsoft.com/en-us/library/aa645739%28VS.71%29.aspx

What is the difference between using the events mechan

6条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-04 12:17

    Raising an event, will call its event handler

    That started off wrong. There could be no event handler. Or many. You don't know. Which is the major difference from calling a method directly. Look up "observer pattern" in your favorite design patterns book.

提交回复
热议问题