I’m wondering why the EventArgs constructor isn’t protected as it seems like waste (although tiny) to allocate resources for an empty object for every event, especially when there is a singleton EventArgs.Empty that’s clearly more efficient to use. This surprises me, especially when other parts of the .NET do have a protected/private constructor to avoid multiple, unnecessary allocations, e.g. Comparer<T>.
Are there any cases where creating a new EventArgs() (not a subclass) actually makes sense, or is the constructor merely available to ease the usage for non-experienced developers?
I would say that its because the
EventArgsclass has theComVisibleattribute set totrue.This is supported by the following FxCop rule: