Value Type EventArgs

I just wanted to blog about some interesting API design discussion we had recently. We discussed whether to relax the event design guidelines to allow value type "event args." This would make raising some events cheaper.

public struct SomethingHappenedEventArgs {
public string SomeArgument { get; set; }

public class SomeType {
public EventHandler<SomethingHappenedEventArgs> SomethingHappened;

One implication of such change is that EventHandler<T> would have to be modified. Today T is constrained to EventArgs and the SomethingHappenedEventArgs struct cannot inherit from EventArgs. The solution is to either remove the constraint from T or to add a marker interface IEventArgs, implement it on EventArgs, and change the constraint to IEventArgs. This of course won't happen in Whidbey (way too late) and in general I am not yet convinced the change is worth the trouble; it needs to be investigated more.

- kc