Why *should* we use EventHandler

后端 未结 6 856
无人及你
无人及你 2021-02-01 14:26

I hate EventHandler. I hate that I have to cast the sender if I want to do anything with it. I hate that I have to make a new class inheriting from EventArgs<

6条回答
  •  忘了有多久
    2021-02-01 14:53

    There is no reason to use it other than its the accepted .net convention and anyone reading your code should understand it fairly easily. For this it's a good reason.

    However it's your code and you can decide what best for you. Of course as you interact with the fcl you will have to do it their way using event handlers.

提交回复
热议问题