RemotingSurrogateSelector.GetSurrogate 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
傳回指定內容中指定型別的適當代理。
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
參數
- context
- StreamingContext
序列化的來源或目的端。
- ssout
- ISurrogateSelector
當這個方法傳回時,包含適合指定物件型別的 ISurrogateSelector。 這個參數會以未初始化的狀態傳遞。
傳回
指定內容中指定型別的適當代理。
實作
- 屬性
備註
遠端代理會處理衍生自 MarshalByRefObject之物件的遠端串行化需求。 在串行化衍生自 MarshalByRefObject 遠端位置的物件期間,遠端代理會建立 , ObjRef 其中包含啟動和與遠端物件通訊所需的所有相關信息。 然後,新建立 ObjRef 的可以傳送至遠端位置,並用來建立 Proxy。