As already noted, the C # specification does not admit a general Delegate restriction. Nor are subclasses of Delegate accepted by the compiler as a general limitation. The best you can do is check and throw an exception. I will show this with a method, but if it is a general class, the constructor will be a great place to check.
public void Foo<T>(T x) { if (x == null) throw new ArgumentNullException("x"); Delegate d = x as Delegate; if (d == null) throw new ArgumentException("Argument must be of Delegate type.", "x");
source share