If you look at the sources for System.Delegate
you'll see that it implements ISerializable
interface:
[Serializable, ComVisible(true), ClassInterface(ClassInterfaceType.AutoDual),__DynamicallyInvokable]
public abstract class Delegate : ICloneable, ISerializable
but the actual implementation throws an exception:
public virtual void GetObjectData(SerializationInfo info, StreamingContext context)
{
throw new NotSupportedException();
}
Why is ISerializable
used; are there any derived types that actually do use serialization?