O'Reilly logo

C# in a Nutshell by Peter Drayton, Ted Neward, Ben Albahari

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 method void GetObjectData(object obj, 
        SerializationInfo info, StreamingContext context);  
   public method object SetObjectData(object obj, 
        SerializationInfo info, StreamingContext context, 
        ISurrogateSelector selector);  
}

Returned By

ISurrogateSelector.GetSurrogate(), SurrogateSelector.GetSurrogate()

Passed To

SurrogateSelector.AddSurrogate()

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required