I have this class:
public class GenericEventArgs<T> : EventArgs
{
public GenericEventArgs() : this(default(T)) {}
public GenericEventArgs(T value) { Value = value; }
public T Value { get; private set; }
}
And this event handler delegate for it:
public delegate void GenericEventHandler<T>(object sender, GenericEventArgs<T> e);
I currently have these in the same file together in a namespace. Is that considered bad/messy/etc.? Cause, in general I would say that each file should contain only one class. So to have it clean I would prefer to have the GenericEventArgs
class in the file alone. But then I have this GenericEventHandler<T>
delegate that I am not sure where I should place. Should it have its own file? With just... that one line kind of? (and the namespace of course)
How do you usually do this?