Does .NET have a built-in EventArgs?

前端 未结 7 1222
梦如初夏
梦如初夏 2020-11-30 06:34

I am getting ready to create a generic EventArgs class for event args that carry a single argument:

public class EventArg : EventArgs
{
    // Prope         


        
7条回答
  •  再見小時候
    2020-11-30 06:55

    The problem with a generic type is that even if DerivedType inherits from BaseType, EventArgs(DerivedType) would not inherit from EventArgs(BaseType). Using EventArgs(BaseType) would thus prevent later using a derived version of the type.

提交回复
热议问题