Is it possible to define a class in C# such that
class GenericCollection<T> : SomeBaseCollection<T> where T : Delegate
I couldn't for the life of me accomplish this last night in .NET 3.5. I tried using
delegate, Delegate, Action<T> and Func<T, T>
It seems to me that this should be allowable in some way. I'm trying to implement my own EventQueue.
I ended up just doing this [primitive approximation mind you].
internal delegate void DWork();
class EventQueue {
private Queue<DWork> eventq;
}
But then I lose the ability to reuse the same definition for different types of functions.
Thoughts?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…