Why does System.Delegate implement ISerializable?

If you look at the sources for System.Delegate, you will see that it implements the interface ISerializable:

[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 used ISerializable; Are there any derived types that really use serialization?

+4
source share

Source: https://habr.com/ru/post/1606393/


All Articles