共用方式為


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 的可以傳送至遠端位置,並用來建立 Proxy。

適用於