共用方式為


ISurrogateSelector.GetSurrogate 方法

定義

搜尋表示指定物件型別的代理,從指定序列化內容的指定代理選取器開始。

public:
 System::Runtime::Serialization::ISerializationSurrogate ^ GetSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, [Runtime::InteropServices::Out] System::Runtime::Serialization::ISurrogateSelector ^ % selector);
public System.Runtime.Serialization.ISerializationSurrogate? GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
public System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
[System.Security.SecurityCritical]
public System.Runtime.Serialization.ISerializationSurrogate GetSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, out System.Runtime.Serialization.ISurrogateSelector selector);
abstract member 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
Public Function GetSurrogate (type As Type, context As StreamingContext, ByRef selector As ISurrogateSelector) As ISerializationSurrogate

參數

type
Type

需要代理之物件 (類別) 的 Type

context
StreamingContext

目前序列化的來源或目的內容。

selector
ISurrogateSelector

當這個方法傳回時,會包含 ISurrogateSelector,其中保有對找到適當代理之代理選取器的參考。 這個參數會以未初始化的狀態傳遞。

傳回

指定內容中指定型別的適當代理。

屬性

例外狀況

呼叫端沒有必要的權限。

適用於