共用方式為


SurrogateSelector.AddSurrogate 方法

定義

將代理加入至已檢查代理的清單中。

public:
 virtual void AddSurrogate(Type ^ type, System::Runtime::Serialization::StreamingContext context, System::Runtime::Serialization::ISerializationSurrogate ^ surrogate);
public virtual void AddSurrogate (Type type, System.Runtime.Serialization.StreamingContext context, System.Runtime.Serialization.ISerializationSurrogate surrogate);
abstract member AddSurrogate : Type * System.Runtime.Serialization.StreamingContext * System.Runtime.Serialization.ISerializationSurrogate -> unit
override this.AddSurrogate : Type * System.Runtime.Serialization.StreamingContext * System.Runtime.Serialization.ISerializationSurrogate -> unit
Public Overridable Sub AddSurrogate (type As Type, context As StreamingContext, surrogate As ISerializationSurrogate)

參數

type
Type

必須有代理的 Type

context
StreamingContext

內容特定資料。

surrogate
ISerializationSurrogate

要為這個型別呼叫的代理。

例外狀況

typesurrogate 參數為 null

代理已經為這個型別和內容存在。

適用於