You don't have to inherit from EventArgs
, but it allows people using your classes to use and handle generic *Handler(object sender, EventArgs e)
declarations.
If you don't inherit from EventArgs
, then they have to use explicitly typed
*Handler(object sender, YairsFakeEventArgs e)
The same goes for just using custom delegates but they are a lot more explicitly different.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…