In a C# event handler, why must the “sender” parameter be an object?

后端 未结 12 803
半阙折子戏
半阙折子戏 2020-12-02 08:19

According to Microsoft event naming guidelines, the sender parameter in a C# event handler \"is always of type object, even if it is possible to use a

12条回答
  •  盖世英雄少女心
    2020-12-02 08:52

    No good reason at all, now there's covarience and contravarience I think it's fine to use a strongly typed Sender. See discussion in this question

提交回复
热议问题