RemotingSurrogateSelector.GetSurrogate 方法

定义

返回给定上下文中给定类型的适当代理项。

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

参数

type
Type

为其请求代理项的 Type

context
StreamingContext

序列化的源或目标。

ssout
ISurrogateSelector

当该方法返回时,包含适合于指定对象类型的 ISurrogateSelector。 此参数未经初始化即被传递。

返回

给定上下文中给定类型的适当代理项。

实现

属性

注解

远程代理项处理派生自 MarshalByRefObject的 对象的远程序列化要求。 在将派生自 MarshalByRefObject 的对象序列化为远程位置期间,远程代理项会创建一个 ObjRef ,其中包含激活远程对象并与之通信所需的所有相关信息。 然后,新创建的 ObjRef 可以发送到远程位置,并用于创建代理。

适用于