Επεξεργασία

Κοινή χρήση μέσω


RemotingSurrogateSelector.GetSurrogate Method

Definition

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

public:
 virtual System::Runtime::Serialization::ISerializationSurrogate ^ GetSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, [Runtime::InteropServices::Out] System::Runtime::Serialization::ISurrogateSelector ^ % ssout);
public virtual System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector ssout);
[System.Security.SecurityCritical]
public virtual System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector ssout);
abstract member GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
override this.GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
[<System.Security.SecurityCritical>]
abstract member GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
override this.GetSurrogate : Type * System.Runtime.Serialization.StreamingContext * ISurrogateSelector -> System.Runtime.Serialization.ISerializationSurrogate
Public Overridable Function GetSurrogate (type As Type, context As StreamingContext, ByRef ssout As ISurrogateSelector) As ISerializationSurrogate

Parameters

type
Type

The Type for which the surrogate is requested.

context
StreamingContext

The source or destination of serialization.

ssout
ISurrogateSelector

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

Returns

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

Implements

Attributes

Remarks

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.

Applies to