Name

ISerializationSurrogate

Synopsis

Objects that implement this interface can be delegated to perform the serialization and deserialization of another object by providing customized methods for GetObjectData( ) and SetObjectData( ). GetObjectData( ) gets the member information to create a SerializationInfo instance, while SetObjectData( ) uses information from a SerializationInfo instance to recreate an object.

public interface ISerializationSurrogate {
// Public Instance Methods
   public void GetObjectData(object obj, SerializationInfo info, StreamingContext context);
   public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, 
        ISurrogateSelector selector);
}

Returned By

ISurrogateSelector.GetSurrogate( ), SurrogateSelector.GetSurrogate( )

Passed To

SurrogateSelector.AddSurrogate( )

Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.