I have a number of EventArgs classes with only one field and an appropriate property to read it:
public class SomeEventArgs : EventArgs
{
private readonly Foo f;
public SomeEventArgs(Foo f)
{
this.f = f;
}
public Foo Foo
{
get { return this.f; }
}
}
Is there any built-in, generic class to implement such behavior or I have to roll my own?
public class GenericEventArgs<T> : EventArgs
{
private readonly T value;
public GenericEventArgs(T v)
{
this.value = v;
}
public T Value
{
get { return this.value; }
}
}
P.S. I wrote a suggestion on Microsoft Connect