RemotingSurrogateSelector.GetSurrogate Method (Type, StreamingContext, ISurrogateSelector)


Returns the appropriate surrogate for the given type in the given context.

Namespace:   System.Runtime.Remoting.Messaging
Assembly:  mscorlib (in mscorlib.dll)

public virtual ISerializationSurrogate GetSurrogate(
	Type type,
	StreamingContext context,
	out ISurrogateSelector ssout


Type: System.Type

The Type for which the surrogate is requested.

Type: System.Runtime.Serialization.StreamingContext

The source or destination of serialization.

Type: System.Runtime.Serialization.ISurrogateSelector

When this method returns, contains an ISurrogateSelector that is appropriate for the specified object type. This parameter is passed uninitialized.

Return Value

Type: System.Runtime.Serialization.ISerializationSurrogate

The appropriate surrogate for the given type in the given context.

A remoting surrogate handles the remoting serialization requirements of an object that derives from a MarshalByRefObject. During serialization of an object that derives from MarshalByRefObject to a remote location, the remoting surrogate creates an ObjRef that contains all the relevant information required to activate and communicate with the remote object. The newly created ObjRef can then be sent to a remote location and used to create a proxy.

.NET Framework
Available since 1.1
Return to top